Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

multi emails single password

     
6:23 pm on Dec 21, 2011 (gmt 0)

Junior Member

joined:Oct 19, 2011
posts: 161
votes: 0


Part of my app has the lost password page. In this case, they enter their login and it is sent. If they do not remember it, they go to the retrieve login, when they enter their email. If there are multiple emails, the client wants to have it sent to all. I can send it to one, but not sure how to build the query or set up the bcc for the mail.

Thanks!
10:25 pm on Dec 21, 2011 (gmt 0)

Full Member

10+ Year Member

joined:July 12, 2002
posts:207
votes: 1


Try this:

mail($to, $subj, $body, "From:$from_email\r\nBcc:$bcc_email");
5:01 pm on Dec 22, 2011 (gmt 0)

Junior Member

joined:Oct 19, 2011
posts: 161
votes: 0


So I'd need a loop to run through the emails and fill in a $bcc_email array, then send them out?
5:23 pm on Dec 22, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Stow the emails in an array (list) and put your mail() call inside the loop.

foreach ($emails as $em) {
// of course there's more code here
mail($em,$subj,$msg,$headers);
}