Insert image in body of email

4

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?

    
asked by anonymous 08.12.2015 / 19:32

2 answers

3

Make sure your email is sent as HTML.

message.IsBodyHtml = true;
message.Body = "<p>Veja essa imagem</p> <br/><br/><img src=\"cid:localDaImagem\" />"
    
08.12.2015 / 19:39
2

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 .

    
08.12.2015 / 19:38