问题描述:

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

  1. My content is not BASE64

  2. 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: <[email protected]l>

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: <[email protected]>

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: <[email protected]>

References: <[email protected]>

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');
相关阅读:
Top