Forums
This topic is locked
email CDOSYS
Posted 28 Oct 2003 00:51:49
1
has voted
28 Oct 2003 00:51:49 posted:
Hi, I am having problems with my script for CDOSYS.Here is the script:
<pre id=code><font face=courier size=2 id=code>
'Dimension variables
Dim objCDOSYSCon
Dim sTo
sTo = request.QueryString("email"
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message"
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration"
'Set and update fields properties
'Out going SMTP server
objCDOSYSCon.Fields("schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.server.net"
'SMTP port
objCDOSYSCon.Fields("schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'CDO Port
objCDOSYSCon.Fields("schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Timeout
objCDOSYSCon.Fields("schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
bjCDOSYSCon.Fields.Update
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
'Who the e-mail is from
objCDOSYSMail.From = " "
'Who the e-mail is sent to
objCDOSYSMail.To = sTo
'The subject of the e-mail
objCDOSYSMail.Subject = "subject"
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
objCDOSYSMail.HTMLBody = "copy into address bar to confirm: www.tikionline.net/confirm.asp?username=request.QueryString(username)"
'Send the e-mail
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
</font id=code></pre id=code>
this sends an email to the sTo person stored in the variable at the top where the sTo is retrieved from the URL; heres an example of my url:
www.server.net/register/registered.asp?username=USERNAME&email=EMAILADDRESS&firstname=FIRST_NAME
When I run this script, I get an error as follows:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/register/registered.asp, line 332
where line 332 is: bjCDOSYSCon.Fields.Update
please help me! urgent help!
also, for the actual htmlbody part, how do I actually turn it to html as it does not seem to work and gives me an error. I would like it so that people can click on a link in the email that would go to that page. this in turn would validate a record for them. if possible please kindly tell me how to add line breaks into it please.
Thanks ever so much guys and girls.
jung-ming
Replies
Replied 07 Nov 2003 12:23:39
07 Nov 2003 12:23:39 Kevin Coster replied:
Not sure if you solved this but looks like a simple typo bjCDOSYSCon.Fields.Update I presume should be objCDOSYSCon.Fields.Update ? <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>