I have tried with both rc2 and 1.x-dev, and the problem seems to be common to both versions (downloaded within last 2 days). When I create an email, I am creating the plain text version as well. I choose the email test, and the email is received fine by the specified account. I then send the email though the forms, and run cron, and the email arrives blank. Email headers are present, but the body is missing.
I have tried using mime_mail, or not, specifying plain text or not, with and without both notification and opt out link, neither of which are being added.
I am using drupal 5.7, and I did the update (4) when I changed from rc2 to 1.x-dev.
I am not using the mailing list yet. I am using 2 addresses, one a user, and one not a user. Both are being delivered, but without the body.
I also had a problem loading the mailing list from a csv file. I eventually had to go into MySQL and INSERT the list. Not everyone will have access to the native database server. I don't know if this problem is related or not (I doubt it but I've been wrong before :-)).
I had a quick look at your code, but nothing jumped out at me. If this has you foxed, at least tell me where to look for the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | activeMailLib.php_.txt | 16.29 KB | sime |
Comments
Comment #1
Triskelion commentedRealized I had not sent a test email using 1.x-dev. Just did it, and it arrived fine. Both the plain text and HTML versions were complete, except there was no opt-out link added. The question is what is different between the sending of the test emails, and the sending of the final version using cron?
Comment #2
Triskelion commentedDid some more tracing. In mailout_send_cron, the test
if (!$data['user_html'] || !$data['html'])always fails because the variables are set to true no matter what is selected on the screen. The variables$final_email_bodyand$final_plainhave the correct values, but there appears to be a problem with the call to mimemail with theunserialize($data['attachments'])parameter, which is being used no matter what the user preference or screen setting is for HTML email.In my case, I only send plain text email from the site, so I have managed to get it to work by commenting out the entire test, leaving only the call to mimemail for plain text.
Comment #3
simeThanks for the debugging detail! I'll use this info to look closely at the problem.
Comment #4
tamlin commentedI have the same problem with 5.x-1.0-rc2 on Drupal-5.7 but the issue only seems to affect hotmail addresses.
Any progress on cause/solution?
Comment #5
creyes123 commentedI was just bitten by this one in the dev version. I was trying to send out a plain text (only) email.
Commenting out the lines as described fixed the problem.
Comment #6
kentully commentedSubscribe.
Comment #7
kentully commentedI have the opposite problem of triskelion's. I need to send all-HTML emails.
I'm no programmer, but I am fairly comfortable with databases. I came up with my own very crude work-around.
I added a "Hotmail" 1/0 field to mailout_message_log, and then added an update query to mailout_send.inc that flags Hotmail/MSN email addresses in mailout_message_log. I then changed the
if (!$data['user_html'] || !$data['html'])test to a "Hotmail/MSN" test. All Hotmail/MSN accounts get plain text, and everyone else gets HTML. Far from perfect, but at least my Hotmail/MSN users are getting something.I've also noticed that no matter what email address is in the site default or the form's "E-mail from this address:" field or in the Return-Path module (http://drupal.org/project/returnpath), Hotmail "unmasks" that address and shows the server's email address ("Account@box124.HostingCompany.com" instead of "User@MySiteDomain.com"). Am I also running up against a Hotmail anti-spam measure (he asked naively) that blocks HTML email from "fishy" accounts?
Except for this issue with Hotmail addresses, I really love this module!
Comment #8
8manj-dupe commentedSubscribing to this thread, we are also experiencing issues with hotmail users.
For further info, sending a test message to hotmail will display no problem, a complete send will result in a blank screen, Hotmail suggests it has received something as the email size is being displayed at 9k (which is about right for size of HTML being sent).
I have updated the version to 5.x-1.0-rc2 as this is now the version that people should be using.
I would interested to see the code of kentully's solution, we have considered adding a query that searches for users with 'hotmail' in there email address, for these matches we would rather send plain text than nothing at all, any suggestions on the correct php syntax for this might be a stop gap solution, until the problem is resolved correctly
Comment #9
8manj-dupe commentedOk, we seem to have fixed the issue, not an ideal solution, as we are editing the module files directly, no override in template.php, be careful when you update this module as unless this fix is included or work is done to revise the module this will rear its ugly head again.
The problem lies in the base64 encoding, hotmail simply doesn't like it (it is a Microsoft app so now suprises there!!)
The fix...
In your mailout_send.inc file edit the line around 610 that starts with the // Send mail and change to the following...
// Send mail
if ((!$data['user_html'] || !$data['html']) && !strpos($data['email_to'],"hotmail")) {
// If either the user or the email is plain text, then send in plain text.
$success = mimemail($data['email_from'], $data['email_to'], $data['email_subject'], $final_email_body, TRUE, array(), $final_plain);
}
elseif (!strpos($data['email_to'],"hotmail")) {
$success = mimemail($data['email_from'], $data['email_to'], $data['email_subject'], $final_email_body, FALSE, array(), '', unserialize($data['attachments']));
}
elseif (strpos($data['email_to'],"hotmail")) {
// added by Jak for Mono Design Ltd
//if (strstr($data['email_to'],'hotmail')) {
// $success = mimemail($data['email_from'], $data['email_to'], utf8_decode($data['email_subject']) . "TEST", utf8_decode($final_email_body), FALSE, array(), '', unserialize($data['attachments']));
//}
$mail->to = trim($data['email_to']);
require_once('activemaillib.php');
$email = new activeMailLib(html);
$email->From(utf8_decode($data['email_from']));
$email->To(utf8_decode($data['email_to']));
$email->Subject(utf8_decode($data['email_subject']));
$email->Message(utf8_decode($final_email_body), 'iso-8859-1', '8Bit');
//$email->priority($mail->priority);
if ($mail->receipt) {
$email->Receipt(utf8_decode($mail->from_address));
}
$email->Send();
$success = $email->isSent($mail->to);
}
Once again a big thanks to my colleague Jak for fixing this and getting me out a mess!! I would dearly like the module developer to take this change on board
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #11
simeJust to be clear, what is activemaillib.php? and what is Jak's recommendation if that is not available?
Comment #12
dwightery commentedan update on this issue. I've also hit this issue on my site, using mailout-5.x-1.0-rc2 version.
I was able to make the change in the mailout_send include (thanks monorob), and then, after alot of foolishiness registering for phpclasses.org to get a copy of activemaillib.php, adding the activemaillib.php script from the phpclasses.org website (http://www.phpclasses.org/browse/package/2145.html)
adding that to my system, i then generated a couple emails that seem to work fine to hot mail addresses.
Any update from the module author as to if this is going to be addressed soon?
thanks,
dwight.
Comment #13
simeThanks dwightery you answered question 1 from #11 :P
Now I am just interested in question 2 - what to do if the extension isn't there. This issue is no doubt going to bite my own customers sooner or later. I will look at that extra script sooner or later, I'm thinking it's something mimemail should be handling, but we'll see.
Comment #14
simeGPL, and not a big file. Sparing people the effort of signing into the spammy php classes site, I never was able to stop them emailing me the first time I signed up, I had a delete rule for it in my gmail :)
This will be a patch on mimemail, with perhaps a short term solution to prevent chaos.
What would be useful is if someone can submit a diff on their mailout (latest dev version pref) so that other people can apply this diff for themselves.
Comment #15
simeCould MonoRob or dwightery please tell me if simply wrapping the final output in utf8_decode() works?
..., utf8_decode($final_email_body), ...Comment #16
simeBetter work going on over here
#310305: Disabling base64 encoding - hotmail compatibility
Comment #17
kenorb commentedSee this as well: #456260: WSOD: smtp_library variable is not removed when mimemail has been disabled
So even you disable Mimemail, still send are through Mimemail and are blank.
Comment #18
8manj-dupe commentedHello Sime,
Not sure on that (utf8_decode($final_email_body)), we haven't tested that. As ar as we need the module to work it does what we need it to do. I can zip up the entire edited module we have if you want it?