Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - CDOSYS problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CDOSYS problem

 Post Reply Post Reply
Author
k00k View Drop Down
Newbie
Newbie


Joined: 18 November 2003
Location: United Kingdom
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote k00k Quote  Post ReplyReply Direct Link To This Post Topic: CDOSYS problem
    Posted: 27 September 2009 at 1:07pm
I am attempting to send an e-mail from within an ASP script using the following code:


Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSConfig = Server.CreateObject("CDO.Configuration")
                   
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "noreply@somewhere.co.uk"
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "thepassword"
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mailserver.co.uk"
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSConfig.Fields.Update

Set objCDOSYSMail.Configuration = objCDOSYSConfig

objCDOSYSMail.From = strFromEmailName & " <" & strFromEmailAddress & ">"
objCDOSYSMail.To = strRecipientName & " <" & strRecipientEmailAddress & ">"
objCDOSYSMailSubject = strSubject
objCDOSYSMail.TextBody = strEmailBodyMessage
objCDOSYSMail.Send

Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing


The mail server, username and password (replaced above with generic values for security) have been verified as correct. I can successfully log into the webmail application using these credentials and send/receive e-mail.

The variables contain (strFromEmailName, strFromEmailAddress, strRecipientName, strRecipientEmailAddress) contain valid data and are active e-mail addresses.

Upon executing the script, I received the incredibly unhelpful:


error '8004020f'

/development/includes/email.asp, line 84


Line 84 being:

objCDOSYSMail.Send


Am I missing something obvious? Has anyone had similar problems?

I am WW web hosting customer on nemesis.websitelive.net.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2009 at 9:56am
The code looks correct to me, however you can get this error if the mail server is rejecting the email.

It could be that the mail server address is wrong or the authentication is incorrect.

The mail server address of mail.mailserver.co.uk is not a valid address for our mail servers. If you are testing the application on your own server then this may also be the problem, try uploading it to our network.
Back to Top
k00k View Drop Down
Newbie
Newbie


Joined: 18 November 2003
Location: United Kingdom
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote k00k Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2009 at 10:03am
I know about the mail server address being "incorrect". I chose not to post the real domain on a public form for obvious reasons :)

Anyway, I managed to resolve the problem. It simply boiled down to an incorrect password. I wish M$ provided slightly more helpful error messages for CDOSYS and I probably would have picked up on the error a bit quicker.

Thanks for the reply!
Back to Top
123Simples View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 July 2007
Location: United Kingdom
Status: Offline
Points: 1192
Post Options Post Options   Thanks (0) Thanks(0)   Quote 123Simples Quote  Post ReplyReply Direct Link To This Post Posted: 15 November 2009 at 4:11pm
Thanks k00k because I was having issues similar to this, and this post really helped me out Thumbs Up
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.