Solved

CDOSYS mail problem

Posted on 2004-08-08
6
747 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

16 Experts available now in Live!

Get 1:1 Help Now