Jump to content

Recommended Posts

I am having this problem using mime mail to send e-mail with multiple cc recipients. To be exact, if I have more than 2 e-mail address in the cc list, starting from 3rd recipient onward, none of them in the cc list is able to receive the e-mail. To put it in another word, only first 2 recipients in the cc list is able to receive the e-mail.. I have no idea what happened at all, hope somebody can give me some direction.

<?php   require_once 'mail.php';   require_once 'mime/mime.php';    $mailTo = array(	  'x@abc.com',   );    $mailCc = array(	  'a@abc.com',	  'b@abc.com',	  // receipient set after this will not be able to receive the e-mail	  'c@abc.com',   );    $headers['Subject'] = 'PHP mail test';   $headers['From'] = 'phpmailteam@abc.com';   $headers['Cc'] = implode(', ', $mailCc);   $message = 'Test send text e-mail';    $mime =& new Mail_Mime;   $result = $mime->setTXTBody($message);   $mbody = $mime->get();    $headers = $mime->headers($headers);    $mail =& Mail::factory('mail');   $result = $mail->send($mailTo, $headers, $mbody);?>

Edited by haike00
Link to post
Share on other sites
The only problem I see with that code is the extra commas at the end of the arrays.
I try removing the last comma but the problem remains..Anyway, thanks for pointing that out. =) Have anybody success in using mime mail to send to more than 2 CC recipients before?
Link to post
Share on other sites
There's not an issue with the code there, it may be an issue with the mail server you're sending through or the recipient server.
I am thinking this could be the problem as well but I have no rights to touch on the configuration of the MTA, my IT dept colleague insists its my code problem.Their reason is simple, we can have multiple cc recipients when we use ms outlook to send the e-mail, and I do not know how to reply this.Do you have any idea what could be the possible configuration on MTA that caused this problem? Or maybe, I can add some headers to the e-mail to make the MTA "thinks" that I am sending e-mail from ms outlook or something similar?
Link to post
Share on other sites

I doubt the MTA is set up to only work for Outlook and would block things that aren't Outlook. One thing you can do is print out $headers after the call to $mime->headers, by that point I believe it is a string. You can show that to your IT guys to help pinpoint the problem.

Link to post
Share on other sites

Okay, this is fun, I turned to use phpmailer and things work. I compare the header between the 2 e-mails generated from mime_mail and phpmailer, there is nothing much difference.I suppose the problem lies with the parameter being set, will study this issue further when I have some free time.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...