www.webdeveloper.com
Results 1 to 5 of 5

Thread: Images in ASP email

Hybrid View

  1. #1
    Join Date
    Oct 2008
    Posts
    10

    Question Images in ASP email

    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. 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"


    %>

  2. #2
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    You already know enough HTML to place the code in the message.. do you know how to create an image?

    <img src="">

  3. #3
    Join Date
    Oct 2008
    Posts
    10
    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>"
    ---------------------------------^

  4. #4
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    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>"

  5. #5
    Join Date
    Oct 2008
    Posts
    10
    Perfect!!! Thank you sooo much!!!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles