Jump to content
Sign in to follow this  
siesha

Sending Email To Multiple Recipient In Php

Recommended Posts

ok ade xsape2 tau camne nk buat multiple recipient dlm php sb cari gune gugel..gagal betui. kot2 ade expert php ni tau kat bawah sy sertakan code yg da sy buat.kalo sorang lepas la antar email tp kalo byk je gagal..please kalo ade sape2 tau leh share kan..

function sendmailnotification2($bilE,$bild,$bilc,$date){
$email='[email protected]';
$sSubject = 'Daily statistic report ';
$sMessage = "

Dear All,

kindly refer to the data below to find daily statistic.

Date = $date

New Registration User = $bilc

Activated member = $bild

product sales = $bilE ";

return sendMail( $email, $sSubject, $sMessage, $ID);
}


kalo script kat atas utk sorang je lepas laa email memg dpt. tp kalo script yg bawah ni utk multiple memg xlepas..xdapek email..anybody can help? B) B)


function sendmailnotification2($bilE,$bild,$bilc,$date){
$email='[email protected]'.',';
$email.='[email protected]';
$sSubject = 'Daily statistic report ';
$sMessage = "

Dear All,

kindly refer to the data below to find daily statistic.

Date = $date

New Registration User = $bilc

Activated member = $bild

product sales = $bilE ";

return sendMail( $email, $sSubject, $sMessage, $ID);
}

Share this post


Link to post
Share on other sites
bleh try function ni:
[php]function sendmailnotification2($emails, $bilE, $bild, $bilc, $date) {
$sSubject = 'Daily statistic report ';
$sMessage = "

Dear All,

kindly refer to the data below to find daily statistic.

Date = $date

New Registration User = $bilc

Activated member = $bild

product sales = $bilE ";
if (is_array($emails)) {
foreach($emails as $email) {
sendMail($email, $sSubject, $sMessage, $ID);
}
} else {
sendMail($emails, $sSubject, $sMessage, $ID);
}
}[/php]

nak pkai, kl satu email:
[php]$emails = "[email protected]";
sendmailnotification2($emails, "bla", "bla", "bla", "bla");
[/php]

kl byk email:
[php]$emails = array("[email protected]","[email protected]","[email protected]");
sendmailnotification2($emails, "bla", "bla", "bla", "bla");
[/php]

kl ada error ke xjd ke gtau blk sbb xtry pn code ni

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...