sending an email with asp

Discussion in 'ASP General' started by isaac2004, Mar 1, 2006.

  1. isaac2004

    isaac2004 Guest

    hello i have a fake online store that creates an invoice and sends it
    to the user. i get this strange error that i dont understand

    the error is
    Microsoft VBScript compilation error '800a0400'

    Expected statement

    /06Winter/levini/A07/checkout03.asp, line 135

    "<tr> " & _


    here is my code watch for text wraps

    'assign the email message body to a variable
    Dim strHTMLMessage
    strHTMLMessage = "<a
    href='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/default.asp'> " &
    _
    "<img
    src='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/images/NetBooks.jpg'
    border='0' alt='NetBooks Logo'> " &_
    "</a><br> " &_
    "<center><font face='Comic Sans MS'
    color='#FF0000'>Order Confirmation</font><br><br> " & _
    "<div align='center'> " & _
    "<center> " & _
    "<table border='0' cellpadding='0' cellspacing='0'
    width="'600'> " & _
    -----------------------------------------------------------------error
    is here
    "<tr> " & _
    "<td width='159' valign='top'><font face='Comic Sans
    MS'>Books Shipped:</font></td>" & _
    "<td width='437'> " & strTitle & _
    "</td> " & _
    "</tr> " & _
    "<tr> " & _
    "<td width='159' valign='top'><font face='Comic Sans
    MS'>Shipping Address:</font></td> " & _
    "<td width='437'><% =strFirstName & " " & strLastName
    & "<br>" & strAddress & " <br>" & strCity & ", " & strState & ", " &
    strZip & "<br><br>"%> " & _
    "</td> " & _
    "</tr> " & _
    "<tr> " & _
    "<td width='159' valign='top'><font face='Comic Sans
    MS'>Total:</font></td> " & _
    "<td width='437'>$<% =TotalPrice %> "

    'Create the mail object
    Dim objMail
    Set objMail = Server.CreateObject("CDO.Message")


    any help would be greatly appreciated
    Isaac
     
    isaac2004, Mar 1, 2006
    #1
    1. Advertising

  2. I don't see anything that would cause that error where you indicated. It's
    possible there's some non-visible character causing an issue, so make sure
    that there are no invisible characters before or after the & and _.

    After you get this error worked out, you'll get an error here:

    ...."<td width='437'><% =strFirstName & ...
    ....strZip & "<br><br>"%> " & _

    Get rid of the<% = and %> and use the same concatenation method you were
    using above. Example:

    .... "<td width='437'> " & strTitle & _
    "</td> " & _
    ....

    Ray at home



    "isaac2004" <> wrote in message
    news:...
    > hello i have a fake online store that creates an invoice and sends it
    > to the user. i get this strange error that i dont understand
    >
    > the error is
    > Microsoft VBScript compilation error '800a0400'
    >
    > Expected statement
    >
    > /06Winter/levini/A07/checkout03.asp, line 135
    >
    > "<tr> " & _
    >
    >
    > here is my code watch for text wraps
    >
    > 'assign the email message body to a variable
    > Dim strHTMLMessage
    > strHTMLMessage = "<a
    > href='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/default.asp'> " &
    > _
     
    Ray Costanzo [MVP], Mar 2, 2006
    #2
    1. Advertising

  3. isaac2004

    Mike Brind Guest

    isaac2004 wrote:
    > hello i have a fake online store that creates an invoice and sends it
    > to the user. i get this strange error that i dont understand
    >
    > the error is
    > Microsoft VBScript compilation error '800a0400'
    >
    > Expected statement
    >
    > /06Winter/levini/A07/checkout03.asp, line 135
    >
    > "<tr> " & _
    >
    >
    > here is my code watch for text wraps
    >
    > 'assign the email message body to a variable
    > Dim strHTMLMessage
    > strHTMLMessage = "<a
    > href='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/default.asp'> " &
    > _
    > "<img
    > src='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/images/NetBooks.jpg'
    > border='0' alt='NetBooks Logo'> " &_
    > "</a><br> " &_
    > "<center><font face='Comic Sans MS'
    > color='#FF0000'>Order Confirmation</font><br><br> " & _
    > "<div align='center'> " & _
    > "<center> " & _
    > "<table border='0' cellpadding='0' cellspacing='0' > width="'600' " & _
    > -----------------------------------------------------------------error is here



    As well as Ray's observation, get rid of the " that appears after
    width= in the line that causes the error.

    That line should read:
    "<table border='0' cellpadding='0' cellspacing='0' > width='600' " & _

    --
    Mike Brind
     
    Mike Brind, Mar 2, 2006
    #3
  4. isaac2004

    Mike Brind Guest

    Mike Brind wrote:
    > isaac2004 wrote:
    > > hello i have a fake online store that creates an invoice and sends it
    > > to the user. i get this strange error that i dont understand
    > >
    > > the error is
    > > Microsoft VBScript compilation error '800a0400'
    > >
    > > Expected statement
    > >
    > > /06Winter/levini/A07/checkout03.asp, line 135
    > >
    > > "<tr> " & _
    > >
    > >
    > > here is my code watch for text wraps
    > >
    > > 'assign the email message body to a variable
    > > Dim strHTMLMessage
    > > strHTMLMessage = "<a
    > > href='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/default.asp'> " &
    > > _
    > > "<img
    > > src='http://yorktown.cbe.wwu.edu/06Winter/levini/A07/images/NetBooks.jpg'
    > > border='0' alt='NetBooks Logo'> " &_
    > > "</a><br> " &_
    > > "<center><font face='Comic Sans MS'
    > > color='#FF0000'>Order Confirmation</font><br><br> " & _
    > > "<div align='center'> " & _
    > > "<center> " & _
    > > "<table border='0' cellpadding='0' cellspacing='0' > width="'600' " & _
    > > -----------------------------------------------------------------error is here

    >
    >
    > As well as Ray's observation, get rid of the " that appears after
    > width= in the line that causes the error.
    >
    > That line should read:
    > "<table border='0' cellpadding='0' cellspacing='0' > width='600' " & _
    >
    > --
    > Mike Brind


    Bugger Google's wrapping!

    That should be:
    "<table border='0' cellpadding='0' cellspacing='0' width='600' " & _

    The extra " had the effect of terminating the string on that line, so
    with a ' after it, everything else that followed was a VBScript
    comment. Then on the next line, VBScript saw what it reads as a new
    string, but there was nothing to reference it, but it expected to see a
    variable assignment or other statement. Hence the error you got.

    --
    Mike Brind
     
    Mike Brind, Mar 2, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bivin
    Replies:
    1
    Views:
    731
    venkat
    Jun 27, 2003
  2. Brent Burkart
    Replies:
    0
    Views:
    443
    Brent Burkart
    Aug 18, 2003
  3. Jacob Yang [MSFT]

    RE: Sending email from ASP.NET

    Jacob Yang [MSFT], Aug 28, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    396
    Tapasvi Mehta
    Aug 28, 2003
  4. Luke
    Replies:
    2
    Views:
    4,786
    Nigel Wade
    Mar 15, 2007
  5. rote
    Replies:
    8
    Views:
    792
Loading...

Share This Page