[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Why do I lose mobile responsiveness when putting html into .net mail message body

I have a html file that I use a streamreader  to read and then use that html code in the body of the .net email.   What happens is though if I few on my iphone the format is all messed up, but if I send as attachment and open it, the format is perfect and stays perfect even if I move the phone on its side.  So something seems to get changed when its part of the body.  Same html,  any ideas.  I didn't  send the code because like I said if I take the streamreader and use a streamwriter on the file, and send the file it looks great, but use streamreader and save to string, and assign to mail body and its all misformatted.


thanks
0
mgmhicks
Asked:
mgmhicks
1 Solution
 
Ioannis ParaskevopoulosCommented:
How do you make your html responsive? I guess you use a library like bootstrap. When you send it as an attachment, then the browser will open the attachment and will honour all the css and javascript rules. Now, if you have it on the body, then the email client will open it. This is totally different than the browser. In most cases you may not have css reference, js reference, inline css is limitted, and all these limitations differ from client to client.

Read through this article
http://litmus.com/help/email-clients/rendering-engines/

I still remember finding a table with what features are allowed in the most popular email clients, but i don't remember the link.

Bottom line, an email client is not a web client and will be picky in what will render. Even if you get nice results with your favorite one, chances sre that you will find differences with the others.

Giannis
0
 
mgmhicksAuthor Commented:
Good Article
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now