1

Hi friends why this is not working ? While doing print_r , $emails ( which is To) is not showing any emails. It's fine when i send to only one person.

$mails = array('[email protected]','[email protected]');
$emails = implode(",",$mails);

$from= '[email protected]);
$subject = 'hello';
$body = 'test';
send_email($from,$emails,$body,$subject);
7
  • 2
    Uhh... are you sure this is the code you're using? There is not send_email function and your script contains a syntax error. Commented Sep 22, 2010 at 14:26
  • @lekensteyn , it works with one mail, ie function is working Commented Sep 22, 2010 at 14:27
  • @sagarmatha : show us your send_email function, and try to post real code instead of a rewrite, which would prevent people posting about syntax errors that aren't in your original script. Commented Sep 22, 2010 at 14:29
  • @JapanPro: @lekensteyn is right - the code, as shown, has a syntax error and calls a function which is not part of the standard PHP, and has not been explained by the OP. Look closer. Commented Sep 22, 2010 at 14:30
  • @Lucanos send_email can be a custom function , inside that mail function can be there. Commented Sep 22, 2010 at 14:33

1 Answer 1

2

Try changing to

$mails = array('[email protected]','[email protected]');
foreach($mails as $k=>$m){
  $mails =trim($mails[$k]);
}
$emails = trim(implode(", ",$mails));

$from= '[email protected]';
$subject = 'hello';
$body = 'test';
send_email($from,$emails,$body,$subject);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.