How to use phpmailer for more than one message/emails?

Discussion in 'PHP' started by 123GoToAndPlay, Feb 20, 2008.

  1. #1
    Hi all,

    What's the correct way to use phpmailer for different bodymessages to different emails

    Would this be correct?
    
    $mail = new PHPMailer();
    
    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->Host = "localhost"; // SMTP server
    $mail->FromName ="MyName";
    $mail->From = "contact@mydomain.com";
    
    etc.
    
    $mail2 = new PHPMailer();
    
    $mail2->IsSMTP(); // telling the class to use SMTP
    $mail2->Host = "localhost"; // SMTP server
    $mail2->FromName ="MyOtherName";
    $mail2->From = "contact@mydomain.com";
    
    etc.
    
    Code (markup):
    Please, advice

    Regards

    [edit]
    i like to sent different body messages to 3 different emails
     
    123GoToAndPlay, Feb 20, 2008 IP