Tuesday, April 24, 2007

Send Mail using PHP mail() function with Html Content

<?php


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

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

// Additional headers

$headers .= 'From: Kals[sender] <krakholiya@gmail.com>' . "\r\n";

// Mail it

$sendx = mail($to, $subject, $content, $headers);


if( $sendx )

{



echo "<font color='red'>Mail Sended.</font>";



}

else

{

$message = "Not Sended. please try again.";

}


?>

1 comment:

leobee said...

Hi Kalpesh

I couldn't find your email on the blog at all, so I hope you see this. I am developing an auto-mkail system - basically need to fire in a web form and the system sends mail to addresses on MySQL table... there would be a few preset queries to pull up the dataset we need, then just need to concatenate the addresses and plug them into a PHP mailer.

Let me know if you can do it!

Leon Berrange
Voxbox Vocal Arts, London
16 June 2007.
admin@vox-box.biz
www.singing-lessons-london.co.uk