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.TextBody = 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&postID
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.emailprodiver.com/signup.php" & VBCrLf & VBCrLf&_
msgbody = msgbody & "Cheers!" & VBCrLf&_
msgbody = msgbody & "Your friends at Business" & VBCrLf & VBCrLf & "www.mydomain.com" & VBCrLf & "Questions? E-mail us at subs@mydomain.com" & VBCrLf & "or toll-free: 1-877-555-1212" & VBCrLf&_
LINE 179 --> Dim YourMail
Set YourMail = Server.CreateObject("CDO.Message")
YourMail.From = f
YourMail.To = t
YourMail.Bcc = "me@mydomain.com"
YourMail.Subject = "Gift subscription from " &fn
YourMail.TextBody = msgbody
YourMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
YourMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
'Server port
YourMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
YourMail.Configuration.Fields.Update
YourMail.Send
set YourMail=nothing
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.com" & VBCrLf & "Questions? E-mail us at subs@mydomain.com" & VBCrLf & "or toll-free: 1-877-555-1212" & VBCrLf&_
Dim TheirMail
Set TheirMail = Server.CreateObject("CDO.Message")
TheirMail.From = "Business <subs@mydomain.com>"
TheirMail.To = f
TheirMail.Bcc = "me@mydomain.com"
TheirMail.Subject = "E-Card Confirmation"
TheirMail.TextBody = msgbody
TheirMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of remote SMTP server
TheirMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
'Server port
TheirMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjMail.Configuration.Fields.Update
TheirMail.Send
set TheirMail=nothing
%>
[/CODE}