Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > sending an email with asp

Reply
Thread Tools

sending an email with asp

 
 
isaac2004
Guest
Posts: n/a
 
      03-01-2006
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

 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      03-02-2006
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: ups.com...
> 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'> " &
> _



 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      03-02-2006

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

 
Reply With Quote
 
Mike Brind
Guest
Posts: n/a
 
      03-02-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the correct email format when sending email using sqldatareader rote ASP .Net 8 04-17-2008 02:14 AM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
RE: Sending email from ASP.NET Jacob Yang [MSFT] ASP .Net 1 08-28-2003 12:55 PM
sending email with asp.net using Microsoft Exchange Brent Burkart ASP .Net 0 08-18-2003 08:27 PM
Problem with sending email from asp.net page using smtp bivin ASP .Net 1 06-27-2003 09:15 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57