ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 6th, 2009, 03:30 AM
SoftwareMatters SoftwareMatters is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 18 SoftwareMatters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 29 sec
Reputation Power: 0
Need help sending email with cdo

Hi,
I am trying to send emails from my asp page with cdo but keep getting the following error:

An error occurred on the server when processing the URL. Please contact the system administrator.

The host of the website is btconnect and i have phoned them to check the server settings which they say are correct. My code is as follows:

Code:
Set oMail = Server.CreateObject("CDO.Message")
	Set iConf = Server.CreateObject("CDO.Configuration")
	Set Flds = iConf.Fields
	iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort 
	iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.btconnect.com"
	iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
	iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

	iConf.Fields.Update
	Set oMail.Configuration = iConf
	oMail.To 		= "kudutravel@btconnect.com"
	oMail.From 		= "kudutravel@btconnect.com"
	oMail.Subject 		= "Test"
	oMail.HTMLBody 		= "Test Message" 
	
	oMail.Send
	Set iConf = Nothing
	Set Flds = Nothing	


Any help or advice would be appreciated

Regards
JD

Reply With Quote
  #2  
Old July 14th, 2009, 11:40 PM
Nilpo's Avatar
Nilpo Nilpo is offline
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Location: New Springfield, OH
Posts: 154 Nilpo User rank is Private First Class (20 - 50 Reputation Level)Nilpo User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2Folding Points: 600856 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 18 h 1 m 47 sec
Reputation Power: 13
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
You need to disable friendly HTTP error messages on your system so that you can see the actual underlying error.
Disable Friendly HTTP Error Messages in Internet Explorer
  1. Open Internet Explorer and choose Internet Options... from the Tools menu.
  2. On the Advanced tab, under the Browsing section, click to clear the Show friendly HTTP error messages check box, and then click OK.
  3. Close the browser.
On the surface, your code looks ok, except that you're using a constant that isn't defined anywhere. If your ASP page does not have META information included for the CDO.Message object, the constant cdoSendUsingPort does not exists and will throw a runtime error. You can either define it, or add the type library information to gain access to enumerated constants.

Defining the constant:
asp Code:
Original - asp Code
  1. <%
  2. Const cdoSendUsingPort = 2
  3.  
  4. Set oMail = Server.CreateObject("CDO.Message")
  5. Set iConf = Server.CreateObject("CDO.Configuration")
  6. Set Flds = iConf.Fields
  7. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")             = cdoSendUsingPort
  8. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")            = "mail.btconnect.com"
  9. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
  10. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")        = 25
  11.  
  12. iConf.Fields.Update
  13. Set oMail.Configuration = iConf
  14. oMail.To       = "kudutravel@btconnect.com"
  15. oMail.From   = "kudutravel@btconnect.com"
  16. oMail.Subject     = "Test"
  17. oMail.HTMLBody   = "Test Message"
  18.  
  19. oMail.Send
  20. Set iConf = Nothing
  21. Set Flds = Nothing
  22. %>


Including the type library information:
asp Code:
Original - asp Code
  1. <%
  2. <!--
  3.     METADATA
  4.     TYPE="typelib"
  5.     UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
  6.     NAME="CDO for Windows 2000 Library"
  7. -->
  8.  
  9. Set oMail = Server.CreateObject("CDO.Message")
  10. Set iConf = Server.CreateObject("CDO.Configuration")
  11. Set Flds = iConf.Fields
  12. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")             = cdoSendUsingPort
  13. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")            = "mail.btconnect.com"
  14. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
  15. iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")        = 25
  16.  
  17. iConf.Fields.Update
  18. Set oMail.Configuration = iConf
  19. oMail.To       = "kudutravel@btconnect.com"
  20. oMail.From   = "kudutravel@btconnect.com"
  21. oMail.Subject     = "Test"
  22. oMail.HTMLBody   = "Test Message"
  23.  
  24. oMail.Send
  25. Set iConf = Nothing
  26. Set Flds = Nothing
  27. %>
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
  #3  
Old December 5th, 2009, 08:16 AM
advancetina advancetina is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Location: US
Posts: 1 advancetina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 30 sec
Reputation Power: 0
Hello everybody!

Hi everybody,My name is Tina, I am 41 yrs old, living in Austin, TX. I'd love to make good close friends here.Thanks,Tina.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Need help sending email with cdo


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap