PHP Mailing

How can I use php to send mail?


Follow the steps to do it yourself
Step 1:
Its realy simple to send mail using php.
First define the parameters to,suject,message and header containing from and reply address
$to = "";
$subject = "Just a test mail";
$message = "Just training on php";
$from = "";
//Header is the portinn where we will set the from address, reply to address, cc address, etc....
//The display of address we see on the top (from,to,replyto) portion of the composer will be based on the header we set

/* To send HTML mail, you can set the Content-type header. */
$headers1 = "MIME-Version: 1.0rn";
$headers1 .= "Content-type: text/html; charset=iso-8859-1rn";
/* additional headers */
$headers1 .= "To: ".$to."rn";
$headers1 .= "From: ".$from."rn";
$headers1 .= "Reply-To: ".$from."rn";

Step 2:
Now we send the mail using php api
mail($to, $subject, $message, $headers);

PHP Topics

Ask Questions

Ask Question