Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Phpmailer refuses to send to multiple recipients 1

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR

Hi guys,

I'm having an issue with PHPmailer: it refuses to send an email to multiple recipients either by adding extras $mail->AddAddress() or by using $mail->AddBCC().

I've noticed it works fine on my local server (windows) but still doesn't work on my distant server (linux).

Any info about that?
 
can you post your mailer script? and are you using the built in SMTP class?
 

Hi Jpadie :)

I've just added
$mail->Host = "smtp.mydomain.com";
$mail->Mailer = "smtp";
... if it's what you meant by "the built in SMTP class".
but still no improvement :(
I still receive only one email.
 
OK ... on popular demand :

Code:
            $mail = new PHPMailer();
            $mail->From = $_SESSION["admin_email"];
            $mail->FromName = strtoupper($_SERVER['HTTP_HOST']);
            $mail->Subject = $mail_subject;
         
                foreach ($order_array["pics"]["files"] as $value) {
                
                $mail->AddEmbeddedImage($order_array["pics"]["path"] . $value, $value, $value, "base64", "image/gif");
            
                }
                       
            $mail_text = hd_string_nobreaks(strip_tags($mail_html));
            $mail->Body = $mail_html;
            $mail->AltBody = $mail_text;
            $mail->AddAddress($GLOBALS["order_member_email"], $GLOBALS["order_member_email"]);
            $mail->AddAddress($_SESSION["admin_email"], $_SESSION["admin_email"]);
 
ok,

at the end of that can you add the following

Code:
echo "<pre>";
print_r ($_SESSION);
echo "<hr/>";
print_r ($mail);

and post back the results.

i'm trying to see whether your session variables are sticking and also what the shape of the $mail object is before you send it. bear in mind that this will disclose email addresses. if you want to avoid this (and you should) , feel free to upload the output in a text file, to
 
Well, the session is obviously sticking since $_SESSION["admin_email"] is also used for the FROM parameter which appears in the only one email I get with the first AddAddress().

And the shape of the mail content does't prevent me from receiving this first email.

I think there must be something else that prevents the second AddAddress() from functioning.
 
BTW, I've also hard coded other email addresses (no vars) in the second AddAddress() but the problem remains.

Must be a server thing because it works locally.
I think I'll just call the class twice.
 
sleidia,
it's not the shape of the mail content that i am checking for. it is the shape of the $mail object.

feel free to upload the debug output as posted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top