Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i created an E- mail signature in Html and copied the Browser output in Gmail Signature tab, it is working fine for Gmail to gmail, or Gmail to yahoo.

But when i open the mail in Outlook in my desktop, the logo is not showing up, i tried using html table as said here,

My HTML markup:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>    
<body>
<table cellspacing="0" cellpadding="0" border="0">
<tbody>

<tr>    
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">
Best Regards,</span><br><br>    
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<span style="text-align: left; color: #000000; font-family: 'Arial', sans-serif; font-size: 13pt; font-weight: bold">Mr. Xyz</span>    
<td style="text-indent: -12.0em;">
<span style="text-align: right; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">Email:  
xyz@something.com</span>
</td>    
</td>
</tr>


<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">    
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">IT
Development Manager</span>  
<td style="text-indent: -12.0em;">
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">Ph No:  
123456</span>    
</td>    
</td>
</tr>

<tr>
<td valign="top" style="padding-left: 0px; padding-top: 7px; padding-bottom: 4px; padding-right: 0px;">
<a href="http://www.example.com/"><img src="http://imgur.com/ZQhgPvj" nosend="1" border="0" alt="E Design" title="xyz.com"></a>
</td>
</tr>

<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">    
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #000000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">Address Line 1,
</span><br>    
</td>
</tr>




<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<br>
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: #0000; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">
Address Line 2.
</span>
</td>
</tr>


<tr>
<td valign="top" style="padding-left: 0px; padding-top: 0px; padding-bottom: 0px; padding-right: 0px;">
<br>
<span style="text-align: left; margin-top: 0px; margin-bottom: 0px; color: green; font-family: 'Arial', sans-serif; font-weight: normal; font-size: 9pt;">
Please consider the environment before printing this e-mail.!
</span>
</td>
</tr>

</tbody>
</table>
</body>
</html>

Expected Output:

enter image description here

May i know what i am doing wrong ?

Any help would be great.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
163 views
Welcome To Ask or Share your Answers For Others

1 Answer

Outlook uses Word as an email editor. You can read about supported and unsupported HTML elements, attributes, and cascading style sheets properties in the following articles in MSDN:

img src=" "

You need to add a reference to an image loaded to any web server or add an image as a hidden attachment. So, the result markup should look like the following one:

img src="cid:attachmentName"

  1. Add the attachment using the Attachments.Add method.
  2. Set the PR_ATTACH_CONTENT_ID property using the PropertyAccessor object.
  3. Set the cid value (see #2) for the reference in the message body.
      string img = "<br/><p><o:p><img src="" + att.FileName
         + "" width=1 height=1 border=0 /></o:p></p>";
      item.HTMLBody = item.HTMLBody.Replace("</body>", img + "</body>");
      string PR_ATTACH_CONTENT_ID = "http://schemas.microsoft.com/mapi/proptag/0x3712001E";
      string HIDDEN_ATTACHMENT = "http://schemas.microsoft.com/mapi/proptag/0x7FFE000B";
      var pa = att.PropertyAccessor;
      if (pa != null)
      {
         pa.SetProperty(PR_ATTACH_CONTENT_ID, att.FileName);
         pa.SetProperty(HIDDEN_ATTACHMENT, false);
      }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...