Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
I am developing a web application and i have to send some information in a table through email. I have used simple HTML tags to display the data in email. I am able to see the data in web browsers(IE and Firefox)perfectly. In outlook express,the data gets mingled.

Can anyone tell what else needs to be done?
Posted
Comments
jkirkerx 8-Sep-13 16:06pm    
So its been months, and you still haven't figured it out yet.
How about marking the issue solved if my solution helped you.

If you are using the namespace System.Web.Mail then keep the
use Html as the body format

see the code below
MailMessage msg = new MailMessage();
msg.From = "<from mailid="">";
msg.To = "<to mailid="">";
msg.BodyFormat = MailFormat.Html;
msg.Priority = MailPriority.High;
msg.Subject = "Test"
msg1.Body = "<your html="" code="">";
SmtpMail.SmtpServer = "<your smtp="" server="">";
SmtpMail.Send(msg);
See whether it helps or not

if you are using the namespace using System.Net.Mail;

message.IsBodyHtml = true;
Please let me know if it is working for you
 
Share this answer
 
Comments
fjdiewornncalwe 5-Jul-11 8:16am    
As an addition, the OP should check and ensure that the content they are placing in the .Body field is valid html as well. Validation is always prudent.
Creating HTML for Email that works in both outlook, outlook express and web browsers is quite tricky.

Quick 30 minute crash course for it
http://sixrevisions.com/web_design/creating-html-emails/[30 minute crash course^]

Some things work, and some don't.

I've tried built-in styles, but they don't work.

It's a combination of having the old school html attributes combined with CSS styling.

So like the element below will work on everything. Stick with fixed values first like 60px, instead of 50%.
<td width="60" style="width: 60px;"></td> 


Here's a snippet of what I use, this is from a html file that I read, replace the data, and feed into the body of net.mail, and it works on everything I have tested on so far.

<table width="700" style="width: 700px; background-color: rgb(234,230,228);" border="0" cellspacing="0" cellpadding="0">
 <tr>
    <td colspan="3" style="height:146px; text-align: left; vertical-align: top;">
        <a href="http://buckridgebarn.com?clid=smtp" target="_blank">
          <img alt="Buck Ridge Barns header image header image" src="http://buckridgebarn.com/EN-US/images/smtp/bg-SMTP_Header.jpg" style="border: none;" />
           </a>
     </td>
 </tr>

 <tr>
     <td valign="top" width="700" height="32" style="width: 700px; height: 32px; text-align: left; padding-left: 20px;">
			         
      </td>
 </tr>

 <tr>
    <td valign="top" width="700" height="64" style="width: 700px; height: 64px; text-align: left; padding-left: 20px;">
      <div style="height: 64px; color: rgb(40,40,40); font-size: 1.2em; font-weight: 800; vertical-align: top;">
        <% smtp.CustomerName %>, has connected to <% smtp.WebsiteName %>
      </div>
    </td>
 </tr>
</table>
 
Share this answer
 
Fix outlook express problems by using of outlook express fix

http://www.outlookexpressfix.com
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900