Solved

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

Posted on 2013-11-15
2
296 Views
Last Modified: 2013-11-21
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
Comment
Question by:mgmhicks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Ioannis Paraskevopoulos earned 500 total points
ID: 39654125
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
 

Author Closing Comment

by:mgmhicks
ID: 39667864
Good Article
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question