Send Email using Mail() Function In PHP

In this tutorial of php we will see how mail() function in php works.
The mail() function in php allow you to send email to anyone directly from code. It return TRUE if mail is properly sent otherwise FALSE.
Example:-
<?php
$to = “info@phptutorials.co.in”;
$subject = “Php tutorial for mail function”;
$body = “PHP code for Beginners.(Body of your message)”;
$headers = ‘From: <abc@xyz.com>’ . “rn”;
$headers .= ‘MIME-Version: 1.0′ . “n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “rn”;
mail($to,$subject,$body,$headers);
?>
Hope this php tutorial is useful for you. Keep following Php Point for more help.

No comments:

Post a Comment