?
Solved

CDOSYS mail problem

Posted on 2004-08-08
6
Medium Priority
?
764 Views
Last Modified: 2008-01-09
Hello,
I am trying to use CDOSYS to send an email on a site.
The thing is, it seemed to work reasonably well a few weeks ago, but no longer does, and I don't think I changed anything relevant.
I've taken out the form inforation that I was using and am setting my fields in the page for testing purposes.
Now the error number I get is this: 80040211 (that's all I get in the log, sorry if its vague) on line 85 which is this line :  objCDOSYSMail.Send

So I can't figure why it worked a few weeks ago when I was testing and now doesn't.
My server host said they didn't change anything.
If anyone can see anything wrong, please let me know.

<%
' email values to set in form
'--------------------------------
Dim  SendersName
Dim  SendersEmail
Dim  EmailSubject
Dim  EmailRecipient
Dim  thanksPage

Dim  objCommand
Dim  rsrecipient
Dim  Emailtext
Dim  objNewMail



' create email
Dim objCDOSYSCon
Dim objCDOSYSMail

Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")


'Outgoing SMTP server
objCDOSYSCon.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "*******.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") = 30
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")  = "*****"

      ' The username for authenticating to an SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "****@****.com"
      ' The password used to authenticate to an SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "*****"

objCDOSYSCon.Fields.Update
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon

Sendersname = "Jeff Hahn"
SendersEmail = "jhahn@f*******.com"
EmailRecipient = "jhahn@f******.com"

objCDOSYSMail.From = sendersname
objCDOSYSMail.To = emailrecipient
objCDOSYSMail.Subject = "test" 'emailsubject
objCDOSYSMail.HTMLBody = "test2" ' request.form("message")
'on error resume next
objCDOSYSMail.Send


Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing


' send email
'objNewMail.Send
Set objNewMail = Nothing

' show thankyou page
if not request("thanksPage")="" then
      response.Redirect(request("thanksPage"))
else
      response.write("<html><body>Message sent..to" & emailrecipient & " dd</body></html>")
end if
response.End

%>


0
Comment
Question by:jhahn72
6 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 11747660
Try changing
objCDOSYSCon.Fields ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

to
objCDOSYSCon.Fields ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
0
 
LVL 4

Expert Comment

by:Tasneem
ID: 11750719
http://www.sunny-beach.net/manual/591.htm

Alternate is comment these lines
objCDOSYSCon.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "*******.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") = 30
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname")  = "*****"

ie the optional parameter setting.. it should ideally work.

One more reason could be replace chr(13) with vbcrlf

Also go through http://www.aspfaq.com/show.asp?id=2026
Regards
0
 

Author Comment

by:jhahn72
ID: 11769204
Well, when I set the ...sendusing") = 1, it works, but I'd like to have it work without the use of the local smtp server.
 
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:jhahn72
ID: 11769410
Success!
Well, what I found was more of a dumb error on my part I think.

The error code that I was getting 80040211, really was telling me that something was wrong with my account. When I had it working last time the mail account that I was using was different.
When I changed things, I had set up a mail account on the server to be sort of generic, but I didn't set up the mailbox. When I changed the account settings to have a mailbox it worked.
When I had an incorrect password or username "iuser@domain.com" it didn't work. When those things were corrected, it did work.

Ok, well, I guess that's it. Thanks for the suggestions.
0
 
LVL 6

Expert Comment

by:masirof
ID: 12709103
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
PAQ - Refund

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

masirof
EE Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12745852
PAQed with points refunded (300)

modulo
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question