Hi guys,
I have tried out the email function, but I only can send to 1 recipient, can someone advise me how to sent email to multiple recipients. Also how can I add "AddReply To" to multiple recipients in include_mail.php?Thanks.
The codes are as below:
include_mail.php
<?php
function mysendmail($to,$subject,$msg){ // set email format to HTML
require_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "xxx.xx.xx.xxx";
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "xxxx@xxxx.com.sg"; // SMTP username
$mail->Password = "xxxxxx"; // SMTP password
$mail->From = "xxxxx@xxxxx.com.sg";
$mail->FromName = "xxxx";
$mail->AddReplyTo("xxxxx@xxxx.com.sg", "xxxxx");
$mail->WordWrap = 100; // set word wrap to 50 characters
$mail->IsHTML(true);
$mail->AddAddress($to);
//if(strlen($cc)>3){
// $mail->AddCC($cc);
//}else{}
$mail->Subject=$subject;
$mail->Body=$msg;
$mail->Send();
}
//echo "msg send $to $subject $msg";
?>
test.php
<?php
include "include_mail.php";
mysendmail('recipient's email','subject','message');
?>

