php help
- Started
- Last post
- 10 Responses
- Raybandana
I have a good one $targetEmail
$targetEmail =
But when I add more emails it doesnt work.
How do I added more emails!Thanks so much!
- Raybandana0
nevemind i figured it out.
Duh.
- Raybandana0
never mind - still doesn't work.
Any help?thanks
- funkage0
$to = ,
Doesn't that work?
- Raybandana0
no the comma's dont work
- Raybandana0
if I put
$targetEmail =
$targetEmail =It will send 2 emails.. but anymore then that it doesnt work.
- the second line would cancel out the first one– you're just overwriting the variables value.mantrakid
- mantrakid0
What is the function you are using to actually send the email? Look up the documentation for that... The function itself has to support having multiple emails in a single variable / string, otherwise you'd need to define it as an array then loop through the array sending an email for each row.
- Raybandana0
I figured it out - i need more IF statement..
SO i can do -
$targetEmail1 =
$targetEmail2 =
$targetEmail3 =Thanks for the help!
- section_0140
An if statement? If anything I would fill an array with the e-mail addresses and loop through it. Like:
$emailArray = array();
//add emails
$emailArray[] =
$emailArray[] =
$emailArray[] =//loop through emails and send
foreach ($emailArray as $email)
{
//whatever your send method is
$this->sendMail($email);
}