Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Email garbled...
PostPosted: Fri Mar 12, 2010 5:16 pm 
Offline
Senior Member

Joined: Tue Mar 09, 2004 3:52 am
Posts: 106
Hi all. So I am sending mail from a PHP application, and I have an issue where the email comes out garbled if the recepient is using a forwarding service, such as GoDaddy, etc.

I am going to follow-up with them to see if it is an issue on their end, but before getting the run-around, I'd like to see if this is an issue that someone else may have encountered.

I am using mb_send_mail() with the following headers:

"From: \"webmaster@example.com\" <webmaster@example.com>\r\nReply-To: \"Webmaster\" <webmaster@example.com>\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset=UTF-8"

Instead of getting this message:

"Test email"

this is what is received

<snip> - base64 content


Last edited by pmmenneg on Fri Mar 12, 2010 5:40 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Fri Mar 12, 2010 5:37 pm 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
Well, that's base64-encoded.

Python, king of all programming languages on Earth wrote:
>>> a="RlJPTTogUGF1bCBNZ......="
>>> import base64
>>> base64.b64decode(a)
'FROM: xxxx\r\n\r\nEMAIL: xxxx\r\n\r\nMESSAGE:\r\n\r\nTesting this feature'


PHP appears to be base64-encoding the e-mail and whatever is receiving isn't reading it correctly (or PHP isn't sending it correctly). Couldn't tell you how to fix it, but now you know what to Google.

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Last edited by jed on Fri Mar 12, 2010 5:46 pm, edited 1 time in total.

Top
   
 Post subject: Ah thanks...
PostPosted: Fri Mar 12, 2010 5:40 pm 
Offline
Senior Member

Joined: Tue Mar 09, 2004 3:52 am
Posts: 106
Can you remove the decoded content from your post? Prefer not to have name and email in the wild for spammers.

Paul

edit by jed: done, sorry.


Top
   
 Post subject:
PostPosted: Sat Mar 13, 2010 1:15 am 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
jed wrote:
Python, king of all programming languages on Earth

Nah, assembly is the king - all others are merely wrappers for mortal programmers who would go blind if they were to see the true code with their naked eyes ;)


Top
   
 Post subject:
PostPosted: Sat Mar 13, 2010 3:32 pm 
Offline
Senior Member

Joined: Tue Mar 09, 2004 3:52 am
Posts: 106
Thanks for the insight guys. Anyone else have any ideas why emails that get forwarded via a service like GoDaddy would be arriving in base64 encoded format?

Thanks!


Top
   
 Post subject:
PostPosted: Mon Mar 15, 2010 3:31 pm 
Offline
Senior Member

Joined: Mon Jun 16, 2008 6:33 pm
Posts: 151
mb_send_mail() calls mb_language; thus as a wild stab in the dark I'd say that you're defaulting to uni (and hence UTF-8/Base64 encoding).

You could either explicitly set the language to English (and have your emails from mb_send_mail sent as quoted-printable); or just use plain old mail().


Top
   
 Post subject: That did it!
PostPosted: Mon Mar 15, 2010 4:27 pm 
Offline
Senior Member

Joined: Tue Mar 09, 2004 3:52 am
Posts: 106
Adding in the mb_language('en') call did the trick. We are using multi-byte for future friendly expansion, if and when we move to supporting more languages, etc.

Thanks for the pointer!

Paul


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group