Send Multiple Emails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • palanisiva
    New Member
    • Mar 2008
    • 1

    Send Multiple Emails

    Hi, I am using PHP mailer to send out 2 different emails.

    The problem I am having is only the first email is ever sent out.

    Below is my code. The first email $to but i add two mail id mail not sending.

    Please help....this is urgent!
    [php]$mail = new PHPMailer();
    $mail->From = "palani@xxxx.co m";
    $mail->FromName = " manager";
    $mail->Host = "xxxxx.com" ;
    $mail->Mailer = "smtp";
    $body .= " manager";
    $text_body .= "Sincerely, \n";
    $text_body .= "manager";
    $mail->Body = $body;
    $mail->AltBody = $text_body;
    $to='palan@xxxx x.com'; //here add to two mail id
    $mail->AddAddress($to ,'palani'); if(!$mail->Send())
    echo "There has been a mail error sending to ";
    // Clear all addresses and attachments for next loop
    $mail->ClearAddresses ();
    ?>[/php]
    reply me
    Last edited by ronverdonk; Mar 18 '08, 03:38 PM. Reason: code tags
  • myth0s
    New Member
    • Jan 2008
    • 32

    #2
    I use :

    [PHP]//php mailer created above....
    $mail->AddAddress("ab c@xyz.com", "Guy #1");
    $mail->AddAddress("de f@xyz.com", "Guy #2");
    //email sent further down....[/PHP]

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Welcome to TSDN!

      Please enclose your posted code in [code] tags (See How to Ask a Question).

      This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

      Please use [code] tags in future.

      MODERATOR

      Comment

      Working...