Solved

CDOSYS mail problem

Posted on 2004-08-08
6
749 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now