php mail not receiving failure deliveries - php

I'm using php mail function to send emails to a rather long mailing list. It works great.
However, I know that many emails in my mailing list are obsolete and yet I'm not receiving a single failure delivery return.
This is what the code of my sent email looks like:
To: test#test.be
Subject: test
From: <test#test.be>
Reply-to: test#test.be
X-Mailer: PHP/7.0.2
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
boundary="-----=9cc0de4ea510d9961f665cefb88d8c3a"
Message-Id: <20160307160659.59354220C6#xxlplan.ovh.net>
Date: Mon, 7 Mar 2016 17:06:59 +0100 (CET)
X-Ovh-Tracer-Id: 12043469829572602714
Above, I replaced the real email address with test#test.be and the email is correct...
Thanks!

Related

Sent message doesn't seem to appear in mailer's thread when using gmail api

I'm trying to reply to the mail axel#example.com from user sam#example.com. This is the composed message:
Date: Tue, 27 Sep 2022 12:23:58 +0000
From: sam#example.com
Reply-To: Axel <axel#example.com>
Message-ID: <CAJ-JwXfBKUO0m0iG9NbEhCua7WbPWv2nSY0_J9_m0F-B-NEMNg#mail.gmail.com>
X-Mailer: PHPMailer 6.6.4 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
To: Axel <axel#example.com>
Subject: Beautiful
WWVzLCBpdCBpcy4uLg==
The message correctly ends up inside thread of email sam#example.com.
But the messages do not appear at all in email axel#example.com.
Currently, I'm using PHPMailer to compose the raw message and use php gmail api to send messages:
$gm = new \Google\Service\Gmail($this->client);
return $gm->users_messages->send('me', $message);

SwiftMail generated email shows text/plain part in multipart email rather than text/html in gmail

I'm using the following to generate a SwiftMail message (excuse the wrappers)
$message = $mailHelper->createMessage(); // This is an instance of Swift_Message
$message->setTo($addresses)
->setFrom([$template->getEmail() => $template->getName()])
->setSubject($template->getSubject())
->setBody($template->getTextContent($twig, $replacements), 'text/plain');
$message->addPart($template->getHtmlContent($twig, $replacements), 'text/html');
$mailHelper->sendMessage($message)
I receive the message ok, but in gmail it shows me the text version. All the encoding looks correct to me.
Return-Path: <[email]>
Received: from [127.0.0.1] (ec2-54-149-246-93.us-west-2.compute.amazonaws.com. [54.149.246.93])
by smtp.gmail.com with ESMTPSA id kv7sm1686300pab.20.2015.09.10.09.11.03
for <[email]>
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
Thu, 10 Sep 2015 09:11:04 -0700 (PDT)
Message-ID: <bf6b3e989767a5cab5ebf8ddbfc27040#swift.generated>
Date: Thu, 10 Sep 2015 16:11:03 +0000
Subject: Welcome to [App]
From: [Company] <[email]>
To: "[email]" <[email]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="_=_swift_v4_1441901463_d2266ae39e8919de6200347d60861abb_=_"
--_=_swift_v4_1441901463_d2266ae39e8919de6200347d60861abb_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
[url]
--_=_swift_v4_1441901463_d2266ae39e8919de6200347d60861abb_=_
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
[url]
--_=_swift_v4_1441901463_d2266ae39e8919de6200347d60861abb_=_--
So it turns out there were two mistakes.
1) Using a custom schema in the href (which I removed from the example above because I considered it sensitive). I guess gmail considers the schema dangerous and then strips the anchor. This is actually a good thing.
2) I was in fact seeing the content from the html version, it's just the only thing that was left was the url, which is what was in the text version too.
TL;DR: Don't use a custom schema for your mobile app in emails. Route it through a browser first.

Email System , Replying from PHP vs Software

I cant get the server to accept my email sent from my end basically i realise it's sending two super different stuff from laravel's mail comparing to hotmail & thunderbird
Basically ,What i normally do is to use hotmail to reply but now i have multiple hotmail i have to manage therefore i was trying to send the email from my web application (laravel) for easier management but the "server" i'm sending to doesnt accept my normal php mail format. I'm definately missing something. Any email experts can advice on this?
Suspect
My content is not BASE64
In-Reply-To < Not sure about this
I'm using Hotmail's SMTP
Normal PHP
X-TMN: [Rmqa/GDhCTtKz/QHzf3PJ3OwikNcUBK3]
X-Originating-Email: [My Email]
Message-ID: <BLU436-SMTP1442C473F3D4FDD87CB62F29A410#phx.gbl>
Return-Path: Email.com
Date: Wed, 14 Jan 2015 17:06:08 +0800
Subject: RE: Subject
From: My Email
To: "Email.com"
<Email.com>
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-OriginalArrivalTime: 14 Jan 2015 09:06:40.0049 (UTC) FILETIME=[68728A10:01D02FD9]
Email Content in pure Text here
Hotmail(Web based)/thunbird style
X-TMN: [vnGLLjV7gUOyWwB/t0Ipyc0a9UiAeX10]
X-Originating-Email: [My Email]
Message-ID: <BAY180-W3892FACB7ED35FBDFF773B9A410#phx.gbl>
Return-Path: My Email
Content-Type: multipart/alternative;
boundary="_4c14973f-4b86-4f73-b78c-eac0375a1262_"
From: My Email
To: "Email.com"
<Email.com>
Subject: RE: Subject
Date: Wed, 14 Jan 2015 17:03:32 +0800
Importance: Normal
In-Reply-To: <14ae7acae73.1948.26c1bd#ismtpd-063>
References: <14ae7acae73.1948.26c1bd#ismtpd-063>
MIME-Version: 1.0
--_4c14973f-4b86-4f73-b78c-eac0375a1262_
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64
<base64 here>
--_4c14973f-4b86-4f73-b78c-eac0375a1262_--
Manage to solve it, as suspected, it's Base64. Basically , I had to customize the content Type on my laravel.
$message->getHeaders()->addTextHeader('Content-Type', 'text/plain; charset="gb2312"');
$message->getHeaders()->addTextHeader('Content-Transfer-Encoding', 'base64');

iCalendar invite is not showing RSVP buttons in email clients

I'm using PHPMailer to send email. My ics content is:
BEGIN:VCALENDAR
METHOD:REQUEST
VERSION:2.0
PRODID:-//FooBar//FooBar Calendar//EN
BEGIN:VEVENT
UID:8f5a0777-bf6d-17d2-f14a-52e7feedf810
ORGANIZER;CN=Foo:foo#bar.com
DTSTART:20140130T191500Z
DTEND:20140130T194500Z
DTSTAMP:20140129T144300Z
SUMMARY:Foo Bar 11
DESCRIPTION:
END:VEVENT
END:VCALENDAR
For some reason I don't see the expected RSVP buttons in any email clients. Both Gmail and Mac Mail simply include the ics as a file attachment, I assume as a fallback. So there must be something wrong. I have not tried Outlook, but I don't see any reason why it would be different in a third client. The contents of an email being sent are below. Can you see anything that looks incorrect? Thank you.
Return-Path: REDACTED
Received: REDACTED
Date: Wed, 29 Jan 2014 09:43:18 -0500
Return-Path: REDACTED
To: REDACTED
From: REDACTED
Reply-To: REDACTED
Subject: Meeting - Foo Bar 11
Message-ID: <7004961cd9df04181047296f98260834#localhost>
X-Priority: 3
X-Mailer: PHPMailer 5.2.7 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_7004961cd9df04181047296f98260834"
Content-Transfer-Encoding: base64
--b1_7004961cd9df04181047296f98260834
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
VG86IEZvbyBCYXINCg0KDQpBZG1pbmlzdHJhdG9yIGhhcyBpbnZpdGVkIHlvdSB0byBhIE1lZXRpbmcNCg0KDQpTdWJqZWN0OiBGb28gQmFyIDExDQoNClN0YXJ0IERhdGU6IDAxLzMwLzIwMTQgMDI6MTVwbSBFU1QoLTA1OjAwKQ0KDQpFbmQgRGF0ZTogMDEvMzAvMjAxNCAwMjo0NXBtIEVTVCgtMDU6MDApDQoNCg0KRGVzY3JpcHRpb246IA0KDQoNCkFjY2VwdCB0aGlzIG1lZXRpbmc6DQoNCmh0dHA6Ly9sb2NhbGhvc3Q6ODg4OC9pbmRleC5waHA/ZW50cnlQb2ludD1hY2NlcHREZWNsaW5lJm1vZHVsZT1NZWV0aW5ncyZ1c2VyX2lkPTEmcmVjb3JkPThmNWEwNzc3LWJmNmQtMTdkMi1mMTRhLTUyZTdmZWVkZjgxMCZhY2NlcHRfc3RhdHVzPWFjY2VwdA0KDQoNClRlbnRhdGl2ZWx5IEFjY2VwdCB0aGlzIG1lZXRpbmcNCg0KaHR0cDovL2xvY2FsaG9zdDo4ODg4L2luZGV4LnBocD9lbnRyeVBvaW50PWFjY2VwdERlY2xpbmUmbW9kdWxlPU1l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jxiciAvPjxiciAvPg0KRGVjbGluZSB0aGlzIG1lZXRpbmc8YnIgLz4NCjxhIGhyZWY9Imh0dHA6Ly9sb2NhbGhvc3Q6ODg4OC9pbmRleC5waHA/ZW50cnlQb2ludD1hY2NlcHREZWNsaW5lJm1vZHVsZT1NZWV0aW5ncyZ1c2VyX2lkPTEmcmVjb3JkPThmNWEwNzc3LWJmNmQtMTdkMi1mMTRhLTUyZTdmZWVkZjgxMCZhY2NlcHRfc3RhdHVzPWRlY2xpbmUiPmh0dHA6Ly9sb2NhbGhvc3Q6ODg4OC9pbmRleC5waHA/ZW50cnlQb2ludD1hY2NlcHREZWNsaW5lJm1vZHVsZT1NZWV0aW5ncyZ1c2VyX2lkPTEmcmVjb3JkPThmNWEwNzc3LWJmNmQtMTdkMi1mMTRhLTUyZTdmZWVkZjgxMCZhY2NlcHRfc3RhdHVzPWRlY2xpbmU8L2E+PGJyIC8+PGJyIC8+DQo8L2JvZHk+DQo8L2h0bWw+
--b1_7004961cd9df04181047296f98260834
Content-Type: text/calendar; method=REQUEST; charset=UTF-8
Content-Transfer-Encoding: base64
QkVHSU46VkNBTEVOREFSDQpNRVRIT0Q6UkVRVUVTVA0KVkVSU0lPTjoyLjANClBST0RJRDotLy9Gb29CYXIvL0Zvb0JhciBDYWxlbmRhci8vRU4NCkJFR0lOOlZFVkVOVA0KVUlEOjhmNWEwNzc3LWJmNmQtMTdkMi1mMTRhLTUyZTdmZWVkZjgxMA0KT1JHQU5JWkVSO0NOPUZvbzpmb29AYmFyLmNvbQ0KRFRTVEFSVDoyMDE0MDEzMFQxOTE1MDBaDQpEVEVORDoyMDE0MDEzMFQxOTQ1MDBaDQpEVFNUQU1QOjIwMTQwMTI5VDE0NDMwMFoNClNVTU1BUlk6Rm9vIEJhciAxMQ0KREVTQ1JJUFRJT046DQpFTkQ6VkVWRU5UDQpFTkQ6VkNBTEVOREFSDQo=
--b1_7004961cd9df04181047296f98260834--
P.S. Sorry about it being base64 encoded. I wanted to show a true representation of the email instead of changing it any way that may skew the results. I just use http://www.base64decode.org/ to decode the contents.
Don't know if it will solve your issue but:
your ORGANIZER property value should be a uri, so foo#bar.com instead of just foo#bar.com
you are missing the ATTENDEE property which is mandatory in an iTIP Request. See https://www.rfc-editor.org/rfc/rfc5546#section-3.2.2
As far as the MIME structure, and seems you seem to care about GMail, the best is to generate an invite from Google Calendar to a non google account, and look at the MIME structure that it generates.

sending mail with swift mailer (php) to gforge email gateway, equal signs (=) at the end of lines

Now, i have another problem with gForge.
I have a form in our intranet to create new trackers in our gforge system. We use Kohana and the Swift Mailer to send smtp emails.
This is what i get (i send the mail as bcc to myself):
Received: from 192.168.150.250 (192.168.150.250) by local
(192.168.50.10) with Microsoft SMTP Server id 15.1.280.1; Wed, 16 Mar 2011
08:51:40 +0100
Message-ID: <1300261898.4d80d7e6#192.168.150.250>
Date: Wed, 16 Mar 2011 08:51:38 +0100
Subject: Test_Issue Jieha (tracker-17)
From: <test#website.de>
To: <gforge-gateway#gforge.local>
BCC: <test#website.de>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Return-Path: test#website.de
X-MS-Exchange-Organization-AuthSource: local
X-MS-Exchange-Organization-AuthAs: Anonymous
MIME-Version: 1.0
priority:4
assignees: wollmannc
stardate: 03/16/2011
end date: 03/17/2011
Von user:
Name: Christian
email: meine#email.de
Bemerkung:
mein bemerkungstext
testinput: mein input
So everything looks fine. But Gforge is telling me:
Received: from local (192.168.200.19) by
local (192.168.50.10) with Microsoft SMTP Server id
15.1.280.1; Wed, 16 Mar 2011 08:51:42 +0100
Received: from gforge.local (centos5 [127.0.0.1]) by
gforge.local (Postfix) with ESMTP id 5DBDED48174 for
<test#website.de>; Wed, 16 Mar 2011 08:51:42 +0100 (CET)
Received: (from nobody#localhost) by gforge.local
(8.13.8/8.13.8/Submit) id p2G7pgvZ004723; Wed, 16 Mar 2011 08:51:42 +0100
Date: Wed, 16 Mar 2011 08:51:42 +0100
From: <noreply#gforge.local>
Message-ID: <201103160751.p2GgvZ004723#gforge.local>
X-Authentication-Warning: gforge.local: nobody set sender to "GForge" <noreply#gforge.local> using -f
To: <test#website.de>
Reply-To: GForge <noreply#gforge.local>
Subject: =?utf-8?B?RmVobyIGJlaWgQmVhcmJlaXRlbiBkZXIgRW1haWw=?=
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
Return-Path: noreply#gforge.local
X-MS-Exchange-Organization-AuthSource: local
X-MS-Exchange-Organization-AuthAs: Anonymous
MIME-Version: 1.0
Ihre Email konnte nicht verarbeitet werden.
Die Anwendung sagte:
* Start Datum ist Erforderlich
* Schlieungs Datum ist Erforderlich
* Close Date must be > Open Date
Ihre Nachricht war:
priority:4
assignees: wollmannc
stardate: 03/16/2011
end d=
ate: 03/17/2011
Von user:
Name: Christian
email: meine#em=
ail.de
Bemerkung:
mein bemerkungstext
testinput: mei=
n input
It tells "the email could not be processed. The application says: a start date is required, a close date is required".
Note the equal signs at the end of some lines. I think that is the maximum line length of "quoted printable" or does the smtp also limit the lines? But why do i get the right mail through BCC? That should be the same mail that gforge gets, right?! Is Gforge doing something with incoming mails?
I'm confused :-( I hope you can help.
It looks like you might be hitting this bug in GForge that prevents mails sent quoted-printable from being parsed correctly.
Your best bet is going to be telling Swift to not use quoted-printable, but I'm not sure how to do that. (I actually want to do this in my own use of Swift...)
GForge guy here. FWIW, starting in GForge 6.3 you can create a custom email address for submitting new Tracker Items directly to a specific project and tracker. No more adding special info to the subject line.
We've also made improvements to our back-end handling of email, to make it more compatible with the quirks of various email clients and exchangers.

Categories