0

b3b9d6d242e982759c39df5fe055ad6a

What i am doing wrong? Or there is some retriction?
i success to read the whole page as my email content, but the images cannot being display
as well as my css style cannot be read too.

2
Contributors
11
Replies
25
Views
4 Years
Discussion Span
Last Post by gahhon
0

How are you including the images? As <img> elements? If so, some email browsers will block that content unless the user clicks on allow.

You can embed the images in your email using the alternateviews property.

http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.alternateviews.aspx

I dont have sample code to share with you as it isnt handy at the moment, but I found this thread on the forums of asp.net that may help you get this accomplished. If not, I'll look for some snippets..

http://forums.asp.net/t/1623382.aspx

0

i am using the server-side image. <asp:Image>
But my image and those CSS are arrange nicely in Default.aspx.
:/

0

Yes but in an email, you would have to specify absolute rerences for the images and even then most email apps will block those external links unless the user approves it in the email app.

0

Then the CSS file is useless already?
i have to declare to each of them instead of writting in .css file?

0

i have to declare to each of them instead of writting in .css file?

I dont know what you mean, and I'm not absolutely sure of the use of an external style sheet with regard to emails. What I have done in the past is use inline styles for the HTML content within the email.

0

e0111ec5c7a3fcbdaa789bbdec0dd821

Okay, now i am done with the image insertion.
It's abit complicated to do it due to needed HTML4 coding but not ASP.Net.
Anyway, as my picture shown at above, how can i move the content to the right side of the image? i try to put the <div style='float:right;'> where this all of the content is under this <div>

2nd problem:-
focus on the sender email picture, it doesn't have any image?
But in that account i already updated the profile picture.

0

yes, you can float, or convert divs and images to inline instead of block, etc...

If you provide your HTML code for the email, it would be easier to help.

0

Yes, in html i am able to float.
But when in inbox it doesn't float to the right. :/

0
            string ImageBody = "<body>";        
            ImageBody += "<img src='cid:imgLogo' alt='#' />";
            ImageBody += "<hr/>";
            ImageBody += "<div style='float:left'><img src='cid:imgForgotPass' alt='#' /></div>";
            ImageBody += "<div style='float:right;font-weight:normal;font-size:14pt;font-family:Berlin Sans FB'>";
            ImageBody += "<div><h1 style='font-weight:bold;font-size:20pt;font-family:Berlin Sans FB;color:blue'>PASSWORD RESET</h1></div>";
            ImageBody += "<div><h4>Hi " + txtUsername.Text + ", </h4></div>";
            ImageBody += "<p>You recently requested to reset your password on your account. If you requested this password reset, <br />please do copy the following password and using that password to login:</p>";
            ImageBody += "<p>Password: <label style='font-weight:bold;font-size:16pt;font-family:Arial Narrow;text-decoration:underline'>" + strPassReset + "</label></p>";
            ImageBody += "<p>Please do go change your password for security purpose after you logged in. <br />If you believe you have received this email in error, or that an unauthorized person has accessed your account,<br /> please do go to reset your password immediately.</p>";
            ImageBody += "<p>Questions? Please contact us.</p>";
            ImageBody += "<p>Thanks. <br />Best Regards,<br />MSJ Bank Financial</p>";
            ImageBody += "</div><div style='font-style:italic; font-weight: normal; font-size: 10pt; font-family:Berlin Sans FB'>Copyright © 2013/14 MSJ Financial Bank System</div>";
            ImageBody += "</body>";
0

Ok, sorry... I dont have time at this moment to provide you with the best styling. I normally dont use table elments for presentation, but it will work and its easy to implement. create a table with one row, to cells...

string ImageBody = "<body>";
ImageBody += "<img src='#' width='32' height='32' />";
ImageBody += "<hr/>";
ImageBody += "<table style='border:none;'><tr>";
ImageBody += "<td><img src='#' width='512' height='512'/></td>";
ImageBody += "<td style='font-weight:normal;font-size:14pt;font-family:Berlin Sans FB'>";
ImageBody += "<div><h1 style='font-weight:bold;font-size:20pt;font-family:Berlin Sans FB;color:blue'>PASSWORD RESET</h1></div>";
ImageBody += "<div><h4>Hi JorgeM, </h4></div>";
ImageBody += "<p>You recently requested to reset your password on your account. If you requested this password reset, <br />please do copy the following password and using that password to login:</p>";
ImageBody += "<p>Password: <label style='font-weight:bold;font-size:16pt;font-family:Arial Narrow;text-decoration:underline'>12345</label></p>";
ImageBody += "<p>Please do go change your password for security purpose after you logged in. <br />If you believe you have received this email in error, or that an unauthorized person has accessed your account,<br /> please do go to reset your password immediately.</p>";
ImageBody += "<p>Questions? Please contact us.</p>";
ImageBody += "<p>Thanks. <br />Best Regards,<br />MSJ Bank Financial</p>";
ImageBody += "</div><div style='font-style:italic; font-weight: normal; font-size: 10pt; font-family:Berlin Sans FB'>Copyright © 2013/14 MSJ Financial Bank System</div></td>";
ImageBody += "</tr></table>";
ImageBody += "</body>";

...
...
...

mailMessage.Body = ImageBody;

2e50c30c0256e0a0d49e7418ce4ffb99

0

dbd0d1837688fa784381a37640aac4db

Thanks JorgeM. It working fine already.
So sorry about that helping me styling. :x

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.