I know I am so close on this, but I cannot see what the syntax fix is. I am sending two e-mails via one asp page; one to the gift giver and one to the recipient...I originally had the message text in the YourMail.TextBo dy = equation, but kept getting syntax errors so have since moved my message body to another section. Nonetheless, I'm still having problems. I am calling mytxt from the virtual conn.asp file.
When I submit my form, I get the error:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/cards/sent.asp, line 179
I'd greatly appreiciate help seeing what I'm not.... thanks!!
[CODE]
<%
RS.Close
Set RS = NOTHING
Conn.Close
Set Conn = NOTHING
mytxt2=mytxt2&p ostID
msgbody = ""
msgbody = msgbody & mytxt & vbcrlf&_
msgbody = msgbody & mytxt1 & VBCrLf & VBCrLf&_
msgbody = msgbody & mytxt2 & VBCrLf & VBCrLf&_
msgbody = msgbody & "The gift page will tell you more details about your gift." & VBCrLf & VBCrLf&_
msgbody = msgbody & "We invite you to get our monthly e-newsletter for more recipes. Click here to join:" & VBCrLf&_
msgbody = msgbody & "http://www.emailprodiv er.com/signup.php" & VBCrLf & VBCrLf&_
msgbody = msgbody & "Cheers!" & VBCrLf&_
msgbody = msgbody & "Your friends at Business" & VBCrLf & VBCrLf & "www.mydomain.c om" & VBCrLf & "Questions? E-mail us at subs@mydomain.c om" & VBCrLf & "or toll-free: 1-877-555-1212" & VBCrLf&_
LINE 179 --> Dim YourMail
Set YourMail = Server.CreateOb ject("CDO.Messa ge")
YourMail.From = f
YourMail.To = t
YourMail.Bcc = "me@mydomain.co m"
YourMail.Subjec t = "Gift subscription from " &fn
YourMail.TextBo dy = msgbody
YourMail.Config uration.Fields. Item ("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
YourMail.Config uration.Fields. Item ("http://schemas.microso ft.com/cdo/configuration/smtpserver") = "localhost"
'Server port
YourMail.Config uration.Fields. Item ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
YourMail.Config uration.Fields. Update
YourMail.Send
set YourMail=nothin g
msgbody = ""
msgbody = msgbody & "Thank you!" & VBCrLf&_
msgbody= msgbody & "Your e-card has been successfully sent to " &t & VBCrLf & VBCrLf&_
msgbody= msgbody & "You can view a copy of your e-card here:" & VBCrLf&_
msgbody= msgbody & mytxt2 & VBCrLf & VBCrLf&_
msgbody= msgbody & "Cheers!" & VBCrLf & VBCrLf&_
msgbody= msgbody & "Your friends at Business" & VBCrLf & VBCrLf & "www.mydomain.c om" & VBCrLf & "Questions? E-mail us at subs@mydomain.c om" & VBCrLf & "or toll-free: 1-877-555-1212" & VBCrLf&_
Dim TheirMail
Set TheirMail = Server.CreateOb ject("CDO.Messa ge")
TheirMail.From = "Business <subs@mydomain. com>"
TheirMail.To = f
TheirMail.Bcc = "me@mydomain.co m"
TheirMail.Subje ct = "E-Card Confirmation"
TheirMail.TextB ody = msgbody
TheirMail.Confi guration.Fields .Item ("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
TheirMail.Confi guration.Fields .Item ("http://schemas.microso ft.com/cdo/configuration/smtpserver") = "localhost"
'Server port
TheirMail.Confi guration.Fields .Item ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
ObjMail.Configu ration.Fields.U pdate
TheirMail.Send
set TheirMail=nothi ng
%>
[/CODE}
When I submit my form, I get the error:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/cards/sent.asp, line 179
I'd greatly appreiciate help seeing what I'm not.... thanks!!
[CODE]
<%
RS.Close
Set RS = NOTHING
Conn.Close
Set Conn = NOTHING
mytxt2=mytxt2&p ostID
msgbody = ""
msgbody = msgbody & mytxt & vbcrlf&_
msgbody = msgbody & mytxt1 & VBCrLf & VBCrLf&_
msgbody = msgbody & mytxt2 & VBCrLf & VBCrLf&_
msgbody = msgbody & "The gift page will tell you more details about your gift." & VBCrLf & VBCrLf&_
msgbody = msgbody & "We invite you to get our monthly e-newsletter for more recipes. Click here to join:" & VBCrLf&_
msgbody = msgbody & "http://www.emailprodiv er.com/signup.php" & VBCrLf & VBCrLf&_
msgbody = msgbody & "Cheers!" & VBCrLf&_
msgbody = msgbody & "Your friends at Business" & VBCrLf & VBCrLf & "www.mydomain.c om" & VBCrLf & "Questions? E-mail us at subs@mydomain.c om" & VBCrLf & "or toll-free: 1-877-555-1212" & VBCrLf&_
LINE 179 --> Dim YourMail
Set YourMail = Server.CreateOb ject("CDO.Messa ge")
YourMail.From = f
YourMail.To = t
YourMail.Bcc = "me@mydomain.co m"
YourMail.Subjec t = "Gift subscription from " &fn
YourMail.TextBo dy = msgbody
YourMail.Config uration.Fields. Item ("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
YourMail.Config uration.Fields. Item ("http://schemas.microso ft.com/cdo/configuration/smtpserver") = "localhost"
'Server port
YourMail.Config uration.Fields. Item ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
YourMail.Config uration.Fields. Update
YourMail.Send
set YourMail=nothin g
msgbody = ""
msgbody = msgbody & "Thank you!" & VBCrLf&_
msgbody= msgbody & "Your e-card has been successfully sent to " &t & VBCrLf & VBCrLf&_
msgbody= msgbody & "You can view a copy of your e-card here:" & VBCrLf&_
msgbody= msgbody & mytxt2 & VBCrLf & VBCrLf&_
msgbody= msgbody & "Cheers!" & VBCrLf & VBCrLf&_
msgbody= msgbody & "Your friends at Business" & VBCrLf & VBCrLf & "www.mydomain.c om" & VBCrLf & "Questions? E-mail us at subs@mydomain.c om" & VBCrLf & "or toll-free: 1-877-555-1212" & VBCrLf&_
Dim TheirMail
Set TheirMail = Server.CreateOb ject("CDO.Messa ge")
TheirMail.From = "Business <subs@mydomain. com>"
TheirMail.To = f
TheirMail.Bcc = "me@mydomain.co m"
TheirMail.Subje ct = "E-Card Confirmation"
TheirMail.TextB ody = msgbody
TheirMail.Confi guration.Fields .Item ("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
TheirMail.Confi guration.Fields .Item ("http://schemas.microso ft.com/cdo/configuration/smtpserver") = "localhost"
'Server port
TheirMail.Confi guration.Fields .Item ("http://schemas.microso ft.com/cdo/configuration/smtpserverport" ) = 25
ObjMail.Configu ration.Fields.U pdate
TheirMail.Send
set TheirMail=nothi ng
%>
[/CODE}
Comment