CodeIgniter Forums
HTML Email not working well with Gmail - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: HTML Email not working well with Gmail (/showthread.php?tid=17769)

Pages: 1 2


HTML Email not working well with Gmail - El Forum - 04-15-2009

[eluser]nbdr[/eluser]
Hello,

I use auth_redux to register users. The email the system sends is received badly on gmail.

It looks like this on Gmail:
Quote:Content-Type: multipart/alternative; boundary="B_ALT_49e5c2342bf50"

This is a multi-part message in MIME format.
Your email application may not support this format.



--B_ALT_49e5c2342bf50
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Alternate message


--B_ALT_49e5c2342bf50
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<title>Account activation</title>
</head>
<body>
Hello nirbdr,
<br /><br />
Thank you for registering to test.
<br /><br />
To activate your account, please follow the link:
<a >Activate account</a>
<br /><br />
If the link is not working, go to http://test.com/user/activate and =
insert the activation code manually.
<br/> Your activation code is ca1763c69063951d2e343ea7b30c76e730dd1457<br /=
>
<br />Your access password is:test&lt;/body&gt;
&lt;/html&gt;

--B_ALT_49e5c2342bf50--

On yahoo it looks OK.

I tried many changes to the config. (remove multipart etc...) non seems to work.

The data from mail debug is this:
Quote:Your message has been successfully sent using the following protocol: mail

User-Agent: CodeIgniter
Date: Wed, 15 Apr 2009 12:09:08 +0300
From: "test"
Return-Path:
Bcc: [email protected], [email protected]
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0

Content-Type: multipart/alternative; boundary="B_ALT_49e5a43485837"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_49e5a43485837
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Hello nirbd,

Thank you for registering to test.

To activate your account, please follow the link:
Activate account

If the link is not working, go to http://test.com/user/activate and
insert the activation code manually.
Your activation code is 7495308b842f029e716a939a63af7b6e56a51d94
Your access password is:test


--B_ALT_49e5a43485837
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
=?utf-8?Q?test.com_(Account_activation)?=
&lt;html&gt;
&lt;body&gt;
Hello nirbd,
<br /><br />
Thank you for registering to test.
<br /><br />
To activate your account, please follow the link:
<a >Activate account</a>
<br /><br />
If the link is not working, go to http://test.com/user/activate and =
insert the activation code manually.
<br/> Your activation code is 7495308b842f029e716a939a63af7b6e56a51d94<br /=
>
<br />Your access password is:test&lt;/body&gt;
&lt;/html&gt;

--B_ALT_49e5a43485837--



HTML Email not working well with Gmail - El Forum - 04-15-2009

[eluser]TheFuzzy0ne[/eluser]
If you open up the Email from within GMail, and at the top-left, where it says reply, there's a drop down menu. Click on that, and then click "Show Original". Please paste the contents of that.


HTML Email not working well with Gmail - El Forum - 04-15-2009

[eluser]nbdr[/eluser]
Here it is:

Delivered-To: [email protected]
Received: by 10.86.84.4 with SMTP id h4cs399102fgb;
Wed, 15 Apr 2009 04:00:30 -0700 (PDT)
Received: by 10.224.80.134 with SMTP id t6mr614874qak.246.1239793230118;
Wed, 15 Apr 2009 04:00:30 -0700 (PDT)
Return-Path: <[email protected]>
Received: from ttttt.com (www.ttttt.com [xx.yy.zz.cc])
by mx.google.com with ESMTP id 4si6977912qyk.80.2009.04.15.04.00.29;
Wed, 15 Apr 2009 04:00:30 -0700 (PDT)
Received-SPF: neutral (google.com: xx.yy.zz.cc is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=xx.yy.zz.cc;
Authentication-Results: mx.google.com; spf=neutral (google.com: xx.yy.zz.cc is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]
Received: (qmail 8140 invoked by uid 48); 15 Apr 2009 14:00:28 +0300
To: [email protected]
Subject: =?utf-8?Q?mysite.com_(Account_activation)?=
User-Agent: CodeIgniter
Date: Wed, 15 Apr 2009 14:00:28 +0300
From: "mysite" <[email protected]>
Reply-To: "[email protected]" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0

Content-Type: multipart/alternative; boundary="B_ALT_49e5be4cd3a97"

This is a multi-part message in MIME format.
Your email application may not support this format.



--B_ALT_49e5be4cd3a97
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Hello myuser1,

Thank you for registering to mysite.

To activate your account, please follow the link:
Activate account

If the link is not working, go to http://mysite.com/user/activate and
insert the activation code manually.
Your activation code is d31fa8b75b833ed1d2a4c812fafa7d87cd8da8a4
Your access password is:pass


--B_ALT_49e5be4cd3a97
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Account activation&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
Hello myuser1,
<br /><br />
Thank you for registering to mysite.
<br /><br />
To activate your account, please follow the link:
<a >Activate account</a>
<br /><br />
If the link is not working, go to http://mysite.com/user/activate and =
insert the activation code manually.
<br/> Your activation code is d31fa8b75b833ed1d2a4c812fafa7d87cd8da8a4<br /=
>
<br />Your access password is:pass&lt;/body&gt;
&lt;/html&gt;

--B_ALT_49e5be4cd3a97--


HTML Email not working well with Gmail - El Forum - 04-15-2009

[eluser]TheFuzzy0ne[/eluser]
The only real difference I can see between your Email and my Email, is the alternate text encoding.

Yours: Content-Transfer-Encoding: 8bit

Mine: Content-Transfer-Encoding: quoted-printable

But I seriously doubt that's the problem.

What I suspect is happening, is that the code is invalid (I know Web-based Email clients are not known for valid HTML, but still). As you're viewing via a Web client, an html and title tag already exists on the page. I'd suggest you try sending the Email without the &lt;html&gt;, &lt;head&gt; or &lt;title&gt; tags. I reckon it'll display properly then.


HTML Email not working well with Gmail - El Forum - 11-28-2009

[eluser]Sander Versluys[/eluser]
Hi all!

I'm having the exact same problem and would like to know if there's some fix?

All my html emails for de CI email class don't play well with GMail, Windows Live Mail doesn't have any problems altough at the end there's a strange 'ALT_lkjlkqs' string.

Any suggestions?


HTML Email not working well with Gmail - El Forum - 12-08-2009

[eluser]LifeSteala[/eluser]
Hello,
I too am having this problem. Has anyone got a fix for this ALT string?

Thanks
LS

[quote author="Sander Versluys" date="1259443763"] at the end there's a strange 'ALT_lkjlkqs' string.[/quote]


HTML Email not working well with Gmail - El Forum - 12-08-2009

[eluser]skunkbad[/eluser]
It might not be the fix for you, but when I had a problem with gmail last week, changing the protocol from 'mail' to 'sendmail' was the solution.


HTML Email not working well with Gmail - El Forum - 12-08-2009

[eluser]alboyd[/eluser]
i'm surprised more people don't ask about this problem. I have this problem on two of my sites. you get "=" every X number of characters. I managed to fix it once by changing the email library - but for some reason that fix isn't working these days.

It's really annoying and comes down to how the library works. There is some stuff in there that ensures the email complies with some sort of protocol for emails... Surely everyone has problems because of it - I would love to know the perfect setup to not have such problems.

I've discussed this on another thread in the past and there was never a resolution from what I can see.


HTML Email not working well with Gmail - El Forum - 12-08-2009

[eluser]skunkbad[/eluser]
[quote author="alboyd" date="1260351126"]i'm surprised more people don't ask about this problem. I have this problem on two of my sites. you get "=" every X number of characters. I managed to fix it once by changing the email library - but for some reason that fix isn't working these days.

It's really annoying and comes down to how the library works. There is some stuff in there that ensures the email complies with some sort of protocol for emails... Surely everyone has problems because of it - I would love to know the perfect setup to not have such problems.

I've discussed this on another thread in the past and there was never a resolution from what I can see.[/quote]

The real problem is probably server configuration, and not the Email class. Having used other email classes before, and also having coded email to run procedurally on different servers, there's just a lot of little things that can make the sending of email not happen exactly the way we want it to. Heck, on my last job, I even called the host to try to figure out what was going on with email, and they didn't even know. The great thing is, it's really easy to use a different library, or use some formmail script like Russell's at Tectite.com. Something should work for you, so just make it happen!


HTML Email not working well with Gmail - El Forum - 12-09-2009

[eluser]Sander Versluys[/eluser]
Instead of looking what exactly causes this problem, i'm now using Swift Mailer which seems to send out my mail just right.

I've replaced the CI Email class with my own (in the app directory, not library in system) and used the same interface so nothing broke in my application.

If I got the time and anyone's interested, I could post an example.