Sending email with PHP using the 'mail' function is simple. Check out these examples:
Here is a simple PHP mail example. Run this script and then check your email. Don't forget to change the value of '$ToAddress' to your email.
After running the previous PHP mail example, you should have an email in the inbox of the email address you specified.
If you don't see anything in your inbox like I did at first, you might want to check your Spam folder. That's where the email ended up when I ran the simple PHP mail example script.
Another PHP mail example
Now we'll add a header to the email sent with the PHP mail example.
I hope these two PHP mail examples served as a good primer for sending email with PHP.
Of course, PHP is capable of doing much more with sending email.
If you'd like to learn more about sending email with PHP and would like to see some other PHP mail examples, why not take a look at the PHP manual page us3.php.net/manual/en/function.mail.php
Netdip.com is an excellent web site that's powered by TYPO3 and other great open source software. Netdip.com is also a fat free alternative to ice cream.
Add comment