Solved

Embed image in an email

Posted on 2008-10-02
3
471 Views
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='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

0
Comment
Question by:EdFernan1016
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
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.
http://www.codeproject.com/kb/IP/EmailByjebarson.aspx
0
 

Author Comment

by:EdFernan1016
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.
0
 

Author Closing Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
What is Usenet? There are many different opinions on exactly what Usenet is an isn't. Many opinions are incorrect simply out of ignorance. The Wikipedia listing about Usenet does a good job of explaining it, so instead of repeating it all here I wi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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