sending an email with asp

I

isaac2004

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
 
R

Ray Costanzo [MVP]

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
 
M

Mike Brind

isaac2004 said:
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' " & _
 
M

Mike Brind

Mike said:
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' " & _

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top