Click to See Complete Forum and Search --> : Images in ASP email


LauraWord
07-14-2009, 11:09 AM
As usual, I have the knowledge to create what I want, but I don't have the vocabulary to look for help when I get stuck! The price you pay for being self taught I guess. :o So I apologize if this answer is out there somewhere, but I did spend a day searching before I posted this.

I created a form that collects user info and feeds it to an ASP page that enters the info where it belongs in an email template. Everything works fine and the resulting e-mail looks great with one exception. I would like to add images and make it look more professional. Any help would be greatly appreciated.

My ASP Code is Below (I removed the content for security and readability):

<%

Dim Body

body = "<html>"
body = body + "<head>"
body = body + "<title>text</title>"
body = body + "</head>"
body = body + "<body>"
body = body + "<TABLE>"
body = body + "<TR><TD>text</TD></TR>"
body = body + "<TR><TD>text</TD></TR>"
body = body + "<TR><TD>text " + Request.Form("Promo") + " text</TD></TR>"
body = body + "<TR><TD>text</TD></TR>"
body = body + "<TR><TD>text<p></p><p></p></TD></TR>"
body = body + "<TR><TD>text</TD></TR>"
body = body + "<TR><TD>" + Request.Form("Name") + "</TD></TR>"
body = body + "<TR><TD>text</TD></TR>"
body = body + "<TR><TD>text</TD></TR>"
body = body + "<TR><TD>(" + Request.Form("Phone") + ") " + Request.Form("Phone1") + "-" + Request.Form("Phone2") +"</TD></TR>"
body = body + "<TR><TD>" + Request.Form("email") + "</TD></TR>"

body = body + "</TABLE>"
body = body + "<table>"
body = body + "<tr><td>.<p></p></td></tr>"
body = body + "<tr><td>.<p></p></td></tr>"
body = body + "<tr><td>.<p></p></td></tr>"
body = body + "</table>"

body = body + "<table>"
body = body + "<tr><td><center>text</center></td></tr>"
body = body + "<tr><td>-------------------------------------------</td></tr>"
body = body + "<tr><td><center>" + Request.Form("Name") + " - text</center></td></tr>"
body = body + "<tr><td><center>(" + Request.Form("Phone") + ") " + Request.Form("Phone1") + "-" + Request.Form("Phone2") +"<br>" + Request.Form("email") + "</center></td></tr>"
body = body + "<tr><td><center>text<br>Promo Code: " + Request.Form("Promo") + "<br>text</center></td></tr>"
body = body + "<tr><td>-------------------------------------------</font></td></tr>"
body = body + "</table>"

body = body + "</body>"
body = body + "</html>"





set mailbot = Server.CreateObject("CDO.Message")

mailbot.To = Request.Form("email") + "," + Request.Form("email2") + "," + Request.Form("email3") + "," + Request.Form("email4") + "," + Request.Form("email5") + "," + Request.Form("email6") + "," + Request.Form("email7") + "," + Request.Form("email8")
mailbot.BCC = "address"
mailbot.From = "address"
mailbot.Subject = "text"
mailbot.HTMLBody = body
mailbot.Send
set mailbot = nothing

Response.write body


'Response.Redirect "confirm.htm"


%>

yamaharuss
07-14-2009, 04:18 PM
You already know enough HTML to place the code in the message.. do you know how to create an image?

<img src="">

LauraWord
07-14-2009, 04:26 PM
I do. I don't have any issues with the HTML. The problem is that I get an error when I try to enter an image thay way.

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/sctraining/resources/18F/BGS_Referral/confirm.asp, line 22

body = body + "<TR><TD><img src="http://a764.g.akamai.net/f/764/16742/1h/www.1800flowers.com/800f_assets/jet/website/images/flowers/banners/long_logo.gif"></TD></TR>"
---------------------------------^

yamaharuss
07-14-2009, 04:59 PM
That's because you need to double up on your quotes... do you see where your error arrow is pointing? To the first quote in your string..

body = body + "<TR><TD><img src="http://a764.g.akamai.net/f/764/16742/1h/www.1800flowers.com/800f_assets/jet/website/images/flowers/banners/long_logo.gif"></TD></TR>"

should be

body = body + "<TR><TD><img src=""http://a764.g.akamai.net/f/764/16742/1h/www.1800flowers.com/800f_assets/jet/website/images/flowers/banners/long_logo.gif""></TD></TR>"

LauraWord
07-14-2009, 05:04 PM
Perfect!!! Thank you sooo much!!!!