Link to home
Start Free TrialLog in
Avatar of EdFernan1016
EdFernan1016Flag for United States of America

asked on

Embed image in an email

I'm working on a code to embed a image to an email. So the recipient will be able to see the image in offline mode and can print the email with the pictures. the pictures will be from the image folder of the site.
SmtpMail.SmtpServer = " "
                Dim CardSendEMail As New MailMessage
                CardSendEMail.From = EmailFromTxt.Text
                CardSendEMail.To = emailToTxt.Text
                CardSendEMail.Subject = " E - Card For You"
                CardSendEMail.BodyFormat = MailFormat.Html
                Dim strTemp As String
                strTemp += "<html>"
                strTemp += "<head>"
                strTemp += "<style>"
                strTemp += "td{"
                strTemp += "font-family:arial;"
                strTemp += "font-size:12px;"
                strTemp += "}"
                strTemp += "</style>"
                strTemp += "</head>"
                strTemp += "<body>"
                strTemp += "<table border=0 cellspacing=4 cellpadding=0>"
                strTemp += "<tr><td></td>E - greetings website</tr>"
                strTemp += "<tr><td>Date Created:" & lbldateCreated.Text & "</td></tr>"
                strTemp += "<tr><td>To:" & RecipientNametxt.Text & "</td></tr>"
                strTemp += "<tr><td>" & messagetxt.Text & "</td></tr>"
                strTemp += "<tr><td>From:" & senderNametxt.Text & "</td></tr>"
 
                strTemp += "<tr><td><a href='http://67.128.94.18/CorpEcards/retrieveRecCard.aspx?id=" & i & "'>http://67.128.94.18/corpEcards/retrieveRecCard.aspx?id=" & i & "</a></td></tr>"
                strTemp += "</table>"
                strTemp += "</body>"
                strTemp += "</html>"
                CardSendEMail.Body = strTemp
                SmtpMail.Send(CardSendEMail)
                Response.Redirect("Cardsent.aspx")

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of JMT116
JMT116
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EdFernan1016

ASKER

thanks for the immediate responds. We are still using asp version 1 and the code from the url you send me is for asp version 2.0.
Thanks, I finally figure it out myself by going to your link and browse the internet for similar problems.