Send Mail using mail function in PHP

PHP is a server side scripting language that is enriched with various utilities required. Mailing is one of the server side utilities that is required in most of the web servers today. Mailing is used for advertisement, account recovery, subscription etc.

In order to send mails in PHP, one can use the mail() method.


$to = "viralpatel.net@gmail.com"; 

$subject = "VIRALPATEL.net";

$body = "Body of your message here you can use HTML too. e.g.

 <b> Bold </b>";
<br>$headers = "From: Peter\r\n";


$headers .= "Reply-To: info@yoursite.com\r\n";

$headers .= "Return-Path: info@yoursite.com\r\n";


$headers .= "X-Mailer: PHP5\n";


$headers .= 'MIME-Version: 1.0' . "\n";


$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


mail($to,$subject,$body,$headers);
?> 

RECENT POSTS

Firefox CSS Hacks

admin
Wednesday, May 15th, 2019

Top 15 Web Design Trends 2018

admin
Friday, May 3rd, 2019