Test email rendering - HTML raw source or HTML pre send? - email

I am testing some HTML email layout, I am not sure to understand which is the HTML I should consider:
use the HTML as it is sent from my server to mailgun (an email service provider)?
use the HTML as I receive it in raw format in the email I receive?
The difference is that in the raw source I receive there are =3D and =20 characters because of the quoted printable format. I'm using testi# but I suppose any rendering software will do, just it's not clear which version of the HTML should be used (needless to say I see =20 everywhere if it's raw, whereas it's perfect if I use the "pure" HTML)

You should use the HTML as it is before being sent. I'm unsure of how testi# works but with other services such as Litmus & Email on Acid you can send a test to them directly from your ESP and they will process that for the previews.
[Added from comment on question to allow close]

Related

Gmail API encoding html and css in addition to base64

I'm pulling some mail from the Gmail API. I've got some sample body text here. This is after base-64 decoding. This is the body of a sample email from my inbox.
Mobile Web Developer - new
Moovweb
http://www.glassdoor.com/partner/jobListing.htm?pos=101&ao=77320&s=224&guid=00000152113cfb4fa8f086376239205e&src=GD_JOB_AD&t=JA&extid=13&exst=O&ist=&ast=O&vt=e&ja=23120341&uido=50A7E22F0FAE3A77415539AAADB05038&slr=false&cb=1451988155901&jobListingId=1579397251&utm_medium=email&utm_source=jobalert&utm_campaign=jobAlertAlert&utm_content=ja-viewjob&encryptedUserId=50A7E22F0FAE3A77415539AAADB05038
Web Developer - new
Applied Systems
http://www.glassdoor.com/partner/jobListing.htmÃœÃLL‰˜[ÃMŒŽIÅ“ÃLŒ￾ â„¢ÃZYLMLÅ’LLØÙ˜￾˜NÅ’
Å’ÃÃÅ’Å’ÃŽLÅ’
YIœÜ˜ÃQÑғ×ÃQ ￾R￾Iâ„¢^YLLÉ™^ÃSÉš\ÃIËœ\ÃSÉ￾￾YIÅ¡ËœOLÅ’ÃŒLÅ’ÃI￾ZYÃMLMÑLŒ‘Œ￾QLÃMÃÃMMLÃŽPPPQÅ’
LÎ œÛ￾Y˜[ÙI˜Ø￾LM
LNNMMNLŽIš›Ø“\Ã[™ÒYLMLN
LŽ
As you can see, after base-64 decoding it, part of it is decoded correctly, such as the title nad the url. The garbage bellow is the content that was originally html and css, I believe, so it makes sense that it would have been encoded differently on Google's side. Does anyone know what encoding this is?
I've tried:
`mb_convert_encoding($body_string, "UTF-8", "Windows-1252");`
and
`mb_convert_encoding($body_string, "UTF-8", "ISO-8859-1");`
With no luck.

could hyperlinks in emails be getting changed by the destination mail server

We send out password-reset emails to business partners who use our intranet. The body of the email contains a hyperlink:
`http://www.ourdomain.com/ResetPassword.aspx?token=....`
But some of the people who receive these emails are saying there's an extra dot in the domain name:
`http://www.ourdomain..com/ResetPassword.aspx?token=....`
I do not see where that could be happening in the program I've written. I store the base url in the web.config:
`http://www.ourdomain.com`
and attach the name of the aspx page and append the token to it.
Are there any corporate anti-virus programs out there which deliberately mangle hyperlinks discovered in the body of emails, to render them invalid and thus unclickable?
This seems to be per the spec of quoted-printable encoding. It just so happens that the length of text in the message breaks to a new line right at the .com (72 characters maybe?). Please verify that this is the case by sending yourself a message and analyzing the quoted-printable source of the message.
System.Net.Mail creating invalid emails and eml files? Inserting extra dots in host names
The solution would be to not use quoted-printable encoding if some email programs cannot correctly interpret the spec.
plainText.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;
//or base64

Hotmail can not properly read email with ! in url

I have a single page app, which has URLs like http://example.com/#!something/something/. The problem is that when I send email containing link to such url, hotmail users get them wrong (I have noticed it only in hotmail, everyone else is good).
The ! is encoded to %21 which makes the url wrong: http://example.com/#%21something/something/
Any ideas what can be done except rewriting my app :-). I am using swiftmailer to send email, but I highly doubt that this is relevant.
According to RFC3986, the "!" character is valid in the fragment (#...) component of URIs, so it should not get encoded using percent-encoding. In this sense, this seems to be an outlook.com bug.
One workaround is to use plain-text emails: based on my tests, outlook.com encodes !'s HTML email links only and plain-text emails are safe.
The real solution, however, is to do your own normalization in the client-side code. URL cracking and normalization is a really tricky business, so I'd expect issues with other email clients, too. Running JavaScript decodeUriComponent() against window.location.hash should give you the unencoded "#!/something/something" version regardless whether the exclamation mark was encoded or not. I understand this calls for modifying the web application that you wanted to avoid, but to my best knowledge this is the way to go.

Sending HTML emails with spring integration

I am using spring integration for a process which ends in an email being sent.
However, it is an HTML email and I receive the source for it, not the rendered HTML.
I have tried to use the mail header enricher provided with spring-integration-mail 2.1.4 to set the content type or activate multipart without result.
Can it be done with the mail header enricher or is it supposed to be configured in some other way?
A pure XML configuration preferable.
Yes you can send HTML via the XML configuration, you just need to set the content type as you said via the header enricher, example code below.
<int-mail:header-enricher id="emailheaderenricher">
<int-mail:content-type value="text/html;"/>
<int-mail:subject value="a subject"/>
<int-mail:to value="mail#somewhere.org"/>
<int-mail:from value="from#example.org"/>
</int-mail:header-enricher>

Problems sending HTML mail with attachment on iPhone

I'm trying to send a JPG attachment with a formatted HTML message. Of course I'm using [picker setMessageBody:emailBody isHTML:YES];
The rest of the code is what it is supposed to be, according to various messages on forums.
What I observe: the contents of the resulting e-mail message depends on the configured e-mail account on your iPhone.
E.g.: for a Yahoo mail account, setting isHTML to YES never results in an HTML message, but setting it to NO does! Bug in Apple stuff?
But, for a GMail account, I've never succeeded to send an HTML mail, it is always received as plain text.
The JPG file is sometimes shown inline, sometimes as an attachment.
All I want: send a JPG file, and a message containing some line breaks. Does anybody have some proven code that does just that, working for all kinds of e-mail accounts?
Even if you set isHTML param to YES, your message body can be sent as plain/text if the message body can be represented as such. And attachments in plain/text messages are not always recognized correctly by some email clients (Outlook).
In my case adding a link in the message body helped. Formatting text as bold with HTML tags works too. Tricky!
Tested on iPod 1G 3.1.3.