need help with CDOSYS Email authentication.

P

Paul

HI! I have got a new server that requires authentication for cdosys to work
and I have modified my script for according to online docs so I got the
first part to work but the second part is driving my crazy :)

The first part below gathers is pretty much standard config and I added the
"sendusername" = "oneusername.com" and "sendpassword" =apassword"

I do a form request for variables and then it sends a page to the user
letting him/her know that we have received the email and it works.

NOW this part is where things stop working. I set objcdosysmail = nothing

Then I created code to make a email for me and it inserts the vars from the
form into the doc. and then I get a error message
-------error message -----------
error '8004020e'
/Email_Content/Scripts/cdosysmail_processor.asp, line 90
----------end of error message--------------

when I look at the line where is fails its the objCDOSYSMail.Send. THis
telling me that somehow the next send is not being authenticated BUT WHY???
and how can I fix it?.

Below is all the code and I remove some of the admin part to make it
smaller.

Thank in advance :)



----------ASP CDOSYS Email Code-----------

<%
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")= "mail.server.com" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "(e-mail address removed)" objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "123456" objCDOSYSCon.Fields.Update 'Form fields and variables 'Please note that the confirmationpageaddress is retrieved from the flashform to redirect the user to a confirmation page. 'You must use the form to send the confimation address, it works with thejsscript at the bottom of this page. dim vname, vemail, vsubject, vcomments, strHTML, sitename,confirmationpageaddress vname = Request.Form("visitor_name") vemail = Request.Form("visitor_email") vsubject = Request.Form("visitor_subject") vcomments = Request.Form("visitor_comments") sitename = Request.Form("sitename") confirmationpageaddress = Request.Form("confirmationpageaddress") 'This is users confirmation email Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = (e-mail address removed) objCDOSYSMail.To = vemail objCDOSYSMail.Subject = " Thank you for your comments" objCDOSYSMail.CreateMHTMLBody "http://www.someaddres/confirmationpage.htm" objCDOSYSMail.Send 'Close the server mail object so that we can re-use it to send again. Set objCDOSYSMail = Nothing 'Re initialize Server mail Object Set objCDOSYSMail = Server.CreateObject("CDO.Message") 'This is the admin's feedback email settings============================================Start============================== Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From = vemail objCDOSYSMail.To = (e-mail address removed) objCDOSYSMail.Subject = vsubject'This is the HTML Page toadmin---------------------------HTML-------START-------------------------------------------- strHTML = strHTML & "<html>" strHTML = strHTML & "<head>" strHTML = strHTML & "<title>User Feedback</title>" strHTML = strHTML & "</html>"'This is the HTML Page toadmin---------------------------HTML-------END-------------------------------- objCDOSYSMail.HTMLBody = strHTML objCDOSYSMail.Send'This is the admin's feedback email settings=================================End===================================== 'Close the server mail & configuration objects Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing %><html><title>Processing Mail</title><body><script type="text/javascript">var confirmationpage = '<%= confirmationpageaddress %>';function proceed(){document.location.href = confirmationpage;}onload = proceed</script></body></html>
 
P

Paul

Paul said:
HI! I have got a new server that requires authentication for cdosys to
work and I have modified my script for according to online docs so I got
the
first part to work but the second part is driving my crazy :)

The first part below gathers is pretty much standard config and I added
the "sendusername" = "oneusername.com" and "sendpassword" =apassword"

I do a form request for variables and then it sends a page to the user
letting him/her know that we have received the email and it works.

NOW this part is where things stop working. I set objcdosysmail = nothing

Then I created code to make a email for me and it inserts the vars from
the form into the doc. and then I get a error message
-------error message -----------
error '8004020e'
/Email_Content/Scripts/cdosysmail_processor.asp, line 90
----------end of error message--------------

when I look at the line where is fails its the objCDOSYSMail.Send. THis
telling me that somehow the next send is not being authenticated BUT
WHY??? and how can I fix it?.

Below is all the code and I remove some of the admin part to make it
smaller.

Thank in advance :)



----------ASP CDOSYS Email Code-----------

<%
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")

'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")=
"mail.server.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 60
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 1
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername")
= "(e-mail address removed)"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword")
= "123456" objCDOSYSCon.Fields.Update 'Form fields and variables 'Please
note that the confirmationpageaddress is retrieved from the flashform to
redirect the user to a confirmation page. 'You must use the form to send
the confimation address, it works with thejsscript at the bottom of this
page. dim vname, vemail, vsubject, vcomments, strHTML,
sitename,confirmationpageaddress vname = Request.Form("visitor_name")
vemail = Request.Form("visitor_email") vsubject =
Request.Form("visitor_subject") vcomments =
Request.Form("visitor_comments") sitename = Request.Form("sitename")
confirmationpageaddress = Request.Form("confirmationpageaddress") 'This
is users confirmation email Set objCDOSYSMail.Configuration =
objCDOSYSCon objCDOSYSMail.From = (e-mail address removed) objCDOSYSMail.To = vemail
objCDOSYSMail.Subject = " Thank you for your comments"
objCDOSYSMail.CreateMHTMLBody
"http://www.someaddres/confirmationpage.htm" objCDOSYSMail.Send 'Close
the server mail object so that we can re-use it to send again. Set
objCDOSYSMail = Nothing 'Re initialize Server mail Object Set
objCDOSYSMail = Server.CreateObject("CDO.Message") 'This is the admin's
feedback email
settings============================================Start==============================
Set objCDOSYSMail.Configuration = objCDOSYSCon objCDOSYSMail.From =
vemail objCDOSYSMail.To = (e-mail address removed) objCDOSYSMail.Subject =
vsubject'This is the HTML Page
toadmin---------------------------HTML-------START--------------------------------------------
strHTML = strHTML & "<html>" strHTML = strHTML & "<head>" strHTML =
strHTML & "<title>User Feedback</title>" strHTML = strHTML &
"</html>"'This is the HTML Page
toadmin---------------------------HTML-------END--------------------------------
objCDOSYSMail.HTMLBody = strHTML objCDOSYSMail.Send'This is the admin's
feedback email
settings=================================End=====================================
'Close the server mail & configuration objects Set objCDOSYSMail =
Nothing Set objCDOSYSCon = Nothing %><html><title>Processing
Mail</title><body><script type="text/javascript">var confirmationpage =
'<%= confirmationpageaddress %>';function
proceed(){document.location.href = confirmationpage;}onload =
proceed</script></body></html>

HI! Its was all above what the server can accept as a FROM address. The that
the objCDOSYSMail.From = had to be a email address that has a authenticated
account on the actual server. I was thinking that it was not accepting the
variable but it apears that it was not that at all but rather for security
reason ( I guess) that the address that its from has to originate from an
actuall email account wihin the server. In other words one of my accounts.

Hopes these helps someone.
 

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

Top