How do I insert an image into the body of the email using C #? I have already been able to send as an attachment but I would like to know how to proceed to send it in the body of the email, is there anything that makes this possible?
How do I insert an image into the body of the email using C #? I have already been able to send as an attachment but I would like to know how to proceed to send it in the body of the email, is there anything that makes this possible?
Make sure your email is sent as HTML.
message.IsBodyHtml = true;
message.Body = "<p>Veja essa imagem</p> <br/><br/><img src=\"cid:localDaImagem\" />"
Where you put body
of email, you will assign HTML
tags. Example:
myMessage.message = "<img src='caminho_da_imagem' alt='Imagem' />"
I'm using myMessage.message
as if it were the body parameter of the email you're sending.
The LocaWeb Wiki gives some tips on what to use for these types of emails .