mail function - send out same email to multiple recipients

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Mon Sep 03, 2012 7:28 pm

Mon Oct 22, 2012 7:30 pm

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:



function mysendmail($to,$subject,$msg){ // set email format to HTML

$mail = new PHPMailer();

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "";
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = ""; // SMTP username
$mail->Password = "xxxxxx"; // SMTP password

$mail->From = "";
$mail->FromName = "xxxx";
$mail->AddReplyTo("", "xxxxx");
$mail->WordWrap = 100; // set word wrap to 50 characters

// $mail->AddCC($cc);

//echo "msg send $to $subject $msg";

include "include_mail.php";
mysendmail('recipient's email','subject','message');

Post Reply