Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

mail function - send out same email to multiple recipients

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

mail function - send out same email to multiple recipients

Postby holy24 » 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');
New php-forum User
New php-forum User
Posts: 6
Joined: Mon Sep 03, 2012 7:28 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.