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: 14 SoftwareMatters User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 51 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: Salem, 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: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 14 h 24 m 29 sec
Reputation Power: 4
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


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




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek