Send email with PHP
In this post, I would like to show you how to send an email with PHP code. It is very useful for a member system which you might like to email the password to member.
To be able to send email, PHP has a function called mail( ).
To send a simple email, mail( ) function takes 3 parameters.
First one is the “destination address“, I use a PHP variable $to to store it in this example.
Second one is the subject line of the email, I use a PHP variable $subjectline to store it in this example.
Third one is the content of the email, I use a PHP variable $content to store it in this example.
Here are the codes within the PHP file:
<?php //create a destination address $to = "xxxxxxxxxxx@phpsuperblog.com"; //create a subject line $subjectline = "test email"; //create the content $content = "How are you"; //Now use the mail() function to send the email mail ($to, $subjectline, $content); ?>
Run this PHP file, and then the email will be sent to the destination address.
Similar Posts:
- Check ip address of host or website with PHP function and HTML form
- Copy one table’s field records into another table’s field in MySQL database with PHP
- Write text into a text file with PHP
- Resize photos for email with FastStone Photo Resizer
- WordPress – Auto create Post into the MySQL database from Excel data file





Add A Comment