I use latest PHPMailer 6.0.0 and working fine except when I want to send mails that use @icloud.com domain. PHPMailer verbose output writes "Message sent" only nothing is received on my iphone. I've tried sending mails from my own mail provider to the same address and this email is received.
I don't use attachments of any kind, just plain text isn't received on my iphone. Sending mails to for example @gmail.com and @ziggo.nl are received well.
My code:
<?php
// Required files
require '../PHPMailer/src/PHPMailer.php';
require '../PHPMailer/src/SMTP.php';
require '../PHPMailer/src/Exception.php';
$mail = new PHPMailer\PHPMailer\PHPMailer;
try {
//Server settings
$mail->SMTPDebug = 4; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = '***'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '***'; // SMTP username
$mail->Password = '***'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom('***', '***');
$mail->addAddress('***@icloud.com', '***'); // Add a recipient
$mail->addReplyTo('***', '***');
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = "This is a test";
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
?>
I can't see from this what host you're sending through, but whatever it is, it will be in the mail server logs on there - PHPMailer's involvement ends after submitting the message.
Are you sure it has nothing to do with headers that are or aren't sent with this mail? Because I read a lot about headers that prevent mails from being marked as spam.
Your messages should not just vanish - they will be sent somewhere and either bounce or report back an immediate error, which will be logged somewhere. There are no "magical" headers that will prevent messages being classified as spam (if there were, spammers would abuse them). You can look into DKIM which can help a bit, but that's entirely optional, and there's no guarantee it _will_ help.
I can confirm apple is silently deleting emails sent from PHP mailer. No bounce back or error report. They dont end up in user spam. Something needs to be looked into. I have manually sent from the account im using with php mailer to the same @me.com address, it works fine.
I've no evidence to work with - provide me with an SMTP transcript from successful direct delivery to a me.com address that then does not appear in an account and we might be able to get somewhere.
Something needs to be looked into
This is open source. Get on with it then.
Hi, I have requested SMTP logs for the message. I assume providing the PHPMailer SMTPdebug output will not help as it shows as successful?
From which server?
From the SMTP server. Unfortunately its shared hosting so I'm not sure how far I'll get (smtp server is SSL0.OVH.NET).
I have requested to logs pertaining to two specific messages: one to a gmail.com (which was received) and one to a me.com (which wasn't)
PHPMailer's SMTP debug log will do fine if you try delivering directly to a me.com MX, like mx1.mail.icloud.com, assuming your network allows you to connect to it and your domain's SPF allows you to send from wherever you're sending from. That way you don't need to get intermediate logs.
@Synchro: Since your are confident that PHPMailer 6 should work sending mails to @icloud.com. Have you tried this yourself and was it succesfull? I find different people struggling with icloud. I have a SPF record which solved being notified as SPAM at hotmail but icloud doesn't show any e-mail. The smtp server I'm using is smtp.rzone.de.
You'll be glad to hear that not only have I managed to reproduce this, I also tracked down why it happens - It's a bug in iCloud. I will push a workaround tomorrow.
Good to hear this problem might be solved in a short period. Thanks in advance.
This fix was released as part of 6.0.1 today, please give it a try.
Hi, working well to the addresses I had on hand to test! Thanks for the quick turnaround!
On 14 September 2017 at 19:01:33, Marcus Bointon ([email protected]) wrote:
This fix was released as part of 6.0.1 today, please give it a try.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
Finally! <3
Thank you very much Synchro! PHPMailer 6.0.1 works perfect and e-mails are well received!!
Thanks for the effort.
Most helpful comment
You'll be glad to hear that not only have I managed to reproduce this, I also tracked down why it happens - It's a bug in iCloud. I will push a workaround tomorrow.