<?php
$to = 'dskanth.99@gmail.com';
$subject = 'Your Verification Code';
$body = 'Hello world';
$headers = "From: shashi <dskanth.99@yahoo.com>". "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n"; // HTML
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // HTML
if(mail("$to","$subject","$body","$headers")) echo 'Mail sent';
else echo 'Error';
@mail("dskanth.99@gmail.com","Another email","Hello world","$headers"); // no error displayed
?>
Note: Better to give double quotes for the parameters in mail function.
$to = 'dskanth.99@gmail.com';
$subject = 'Your Verification Code';
$body = 'Hello world';
$headers = "From: shashi <dskanth.99@yahoo.com>". "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n"; // HTML
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // HTML
if(mail("$to","$subject","$body","$headers")) echo 'Mail sent';
else echo 'Error';
@mail("dskanth.99@gmail.com","Another email","Hello world","$headers"); // no error displayed
?>
Note: Better to give double quotes for the parameters in mail function.
Comments
Post a Comment