How can I use php to send mail?
Follow the steps to do it yourselfStep 1:
Its realy simple to send mail using php.
First define the parameters to,suject,message and header containing from and reply address
<?php Step 2:
$to = "email@example.com";
$subject = "Just a test mail";
$message = "Just training on php";
$from = "firstname.lastname@example.org";
//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";
Now we send the mail using php api
mail($to, $subject, $message, $headers);