Solved

CDOSYS mail problem

Posted on 2004-08-08
6
748 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

943 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

5 Experts available now in Live!

Get 1:1 Help Now