Embed image in an email

Posted on 2008-10-02
Last Modified: 2013-11-30
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='" & i & "'>" & i & "</a></td></tr>"

                strTemp += "</table>"

                strTemp += "</body>"

                strTemp += "</html>"

                CardSendEMail.Body = strTemp



Open in new window

Question by:EdFernan1016
  • 2

Accepted Solution

JMT116 earned 500 total points
ID: 22625933
I think this tutorial will provide you with the solution you need.  It uses an alternateView and a linkedResource.

Author Comment

ID: 22636310
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.

Author Closing Comment

ID: 31502447
Thanks, I finally figure it out myself by going to your link and browse the internet for similar problems.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The most common mistakes I hear or read about email usually begin with people talking about POP3 and IMAP, so let's clear those off the table: POP3 and IMAP have absolutely nothing to do with sending or receiving email, so get that notion out of you…
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now