Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a written a console C# program, that send email to the users with the image embedded into the body of mail. I have referred this link to write the program
http://www.codeproject.com/Articles/34467/Sending-Email-Using-Embedded-Images

In the email body, I have mentioned the font size as
HTML
"10" and image alignment as "middle"
string body = "<html><body><b><font size=\"10\" face=\"Helvetica\" color=\"B0B0B0\">Some Text</font></b><br><br><img align=\"middle\" src=\"cid:Pic1\"></body></html>";

but when the mail is received by the users in their outlook, the fontsize of the body is appears as 36 and the picture doesn't get to the center of the body of the email message body.

Kindly suggest, how to overcome this issue.
Posted
Updated 24-Feb-14 22:00pm
v2
Comments
Abhishek Pant 25-Feb-14 4:19am    
you could use dynamic html template too..

The size you specify in the font tag is a number from 1 to 7, where 3 is the default of the browser (or mail client in this case). This attribute is also not supported in HTML 5 and should be avoided. See also w3schools[^].

It's better to use the style tag instead of the font tag, e.g.
HTML
<b style="font-size: 10px; font-family: 'Helvetica'; color: #B0B0B0;">some text</b>


Not sure what the deal is with the picture, you do have to send it with in the header of the mail with the correct name.
 
Share this answer
 
v2
Create a separate template, design it in your way and fill it dynamically. So that your CSS will apply properly.
 
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