Advertisement

04.20.2008 at 07:14AM PDT, ID: 23337694
[x]
Attachment Details

HTMLBody not properly displayed in yahoo mail

Asked by lslim in Extensible HTML (XHTML), Cascading Style Sheets (CSS), Hypertext Markup Language (HTML)

Tags: VB, HTML, IE, FireFox, Safari

Hi there,

I used email object in VB app to read stream from a HTML document (index.htm) and write into the email object's HTMLBody. The email will be sent to Outlook, yahoo mail, gmail, hotmail, and others.

I have used <DIV> in displaying contents. Within the <DIV>, I set the style for the fonts, the margin, line-height. Also alignment in the <DIV> tag itself.

When I sent the same email to Outlook, yahoo mail, gmail and hotmail, the alignment of the contents is correct in Outlook, gmail and hotmail, but not in yahoo mail. Everything in yahoo mail is left-aligned.

I read some articles about HTML body in Internet, and most people suggest using the most basic html tags to make sure that it works in most emails. So, I tried to set the style in <td> tag, and remove the <div>. However, that doesn't seem to work.

I attach here the code snippet.

What is the problem with the html codes and what is the best way to write it so that the HTML body is displayed correctly in most emails?

Thanks.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
<table border="0" cellspacing="0" cellpadding="0" width="100%" <!-- container -->
  <tr>
    <td width="640px">
      <table width="640px" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td align="left">
            <div style="font-family: Arial; font-size: 15pt; line-height: 22pt; font-weight: bold, margin-bottom: 0px;" align="left">This is the title of the content</div>
            <div style="font-family: Arial; font-size: 15pt; line-height: 22pt; margin-bottom: 18px;" align="left">This is author</div>
            <div style="font-family: Arial; font-size: 13pt; line-height: 15pt; margin-bottom: 18px;" align="justify">In this div, the content should be displayed in justified alignment. It works in outlook, gmail and hotmail, but not yahoo mail.</div>
            <div style="font-face: Arial; font-size: 11pt; line-height: 13pt; margin-bottom: 18px;" align="justify">Some URL goes here.</div>
          <td>
        </tr>
      </table>   
    </td>  
  </tr>
</table>
[+][-]04.20.2008 at 11:27AM PDT, ID: 21397103

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible HTML (XHTML), Cascading Style Sheets (CSS), Hypertext Markup Language (HTML)
Tags: VB, HTML, IE, FireFox, Safari
Sign Up Now!
Solution Provided By: Xyptilon2
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628