hi
i want to send mail to more than one user.the below code is not working.please do tell me how to do tat

<?
    $to  = "s@gmail.com";// note the comma
    $bcc = "s@gmail.com";
    $from="l.w@cs.com";
	$spaces="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	$sub="hi bye";
	$body="<html><head></head><body>";
	$body.="<span style='text-align: left;text-indent: 5px;font-family: Verdana;font-size: 11px;color: #404040;'>";
	$body.="Hi Client: <br /><br /> $spaces I have prepar<br />$spaces $spaces Kind regards,<br />";
	$body.="<br /><b>Thanks,</b><br /><b>Agreements Mgmt group</b><br />";
	$body.="</span></body></html>";
 	$headers = "MIME-Version: 1.0\r\n";
	$headers .= "Content-Type: text/html; charset=iso-8859-1" . "\r\n";
 	$headers .= 'From: ' . $from . "\r\n" .
 	$headers .= 'Bcc: ' . $bcc . "\r\n" .
    	'X-Mailer: PHP/' . phpversion();
    $mailstatus=mail($to,$sub,$body,$headers);

?>

Recommended Answers

All 2 Replies

Well no. That wouldn't work, seeing as you only specify one email recipient.

It should be something like: $to = "user@example.com, [email]anotheruser@example.com[/email]"

if u dont want to show email id of users u can use bcc but to add many user in to follow ATil

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.