| | |
Send an Email in PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello Im looking for a real simple way, if possible with no databases involved, to send an email to a hosting account on godaddy. I believe they use smtp.secureserver.net for the smtp server. I have a form that asks for the persons name and their email..I am later going to make some sortof mailing list, So if you know of a easily integratable mailing list app let me know.
Thanks In advance for any help offered
Thanks In advance for any help offered
The chances are quite good they already configured the server for you, so you can simply send a mail.
HAve a look at this function to send an email; http://www.php.net/manual/en/function.mail.php
Example:
HAve a look at this function to send an email; http://www.php.net/manual/en/function.mail.php
Example:
php Syntax (Toggle Plain Text)
<?php $mail['to'] = 'person@domain.suffix'; $mail['from'] = 'you@' . $_SERVER['SERVER_NAME'] . '.suffix'; $mail['subject'] = 'Newsletter'; $mail['message'] = "Hello,\r\n\r\nHow are you?"; $mail['message'] .= "\r\n\r\nUntil Later\r\nYour Team"; $mail['header'] = "From: \"Your Team\" <" . $mail['from'] . ">\r\n"; $mail['status'] = @mail($mail['to'], $mail['subject'], $mail['message'], $mail['header']); if ($mail['status'] == false) { echo 'Failed to send mail to ' . $mail['to'] . '.<br>Error: ' . error_get_last(); exit; } else { echo 'Sent mail to ' . $mail['to'] . ' with no errors.'; continue; } ?>
Ah, the gdform. I tried for over a week to send mail through GoDaddy. My client had the small to medium sized business plan. I would test the code on different servers and it would work, but when I'd move it onto the GoDaddy machine, it would fail. I wound up making a page using php_info() and found that mail, along with many other functions were disabled on the server. If you haven't yet done so, create a php_info page and have a look.
It appears that mail is enabled from what I can tell because the phpinfo lists send_mail and smtp info. I havent tried out the code yet but I will soon.
![]() |
Similar Threads
- PHP Sendmail Tutorial (PHP)
- send email with attachment (PHP)
- Send email through php? (PHP)
- Need Help Making a Form send to an email using PHP (PHP)
- Sending HTML email via PHP mail function (PHP)
- Using HTML tags in PHP code (PHP)
- Using PHP to Send Email to a single DB list member every 24 hrs. (PHP)
- PHP Email (PHP)
Other Threads in the PHP Forum
- Previous Thread: help in sql query
- Next Thread: PHP codes to search MySQL
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube






