473,750 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error message when using CDO.Configurati on in W2k3 to send mail

11 New Member
I am beginning to receive an error message when trying to execute the .Send command when using the CDO.Configurati on and CDO.Message in a W2k3 server environment on WXP machines and IE6. Below is a sample of the code i am using but when attempting to modify existing code or create a new page using this code i receive an error in the .Send line in IE. I will paste the error message when i return to work but basically states error executing command in line /xxx.

Expand|Select|Wrap|Line Numbers
  1. <%
  2. response.buffer = true
  3. type=request.form("type")
  4. body=request.form("body")
  5. email=request.form("email")
  6. subject=request.form("subject")
  7. recipient=request.form("recipient")
  8. %>
  9. <% 
  10.     sch = "http://schemas.microsoft.com/cdo/configuration/" 
  11.  
  12.     Set cdoConfig = CreateObject("CDO.Configuration") 
  13.  
  14.     With cdoConfig.Fields 
  15.         .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
  16.         .Item(sch & "smtpserver") = "<mail server name omitted for privacy>" 
  17.         .update 
  18.     End With 
  19.  
  20.     Set cdoMessage = CreateObject("CDO.Message") 
  21.  
  22. output = "This is a " & type & "request. " & Chr(13) & body
  23.  
  24.     With cdoMessage 
  25.         Set .Configuration = cdoConfig 
  26.         .From = email 
  27.         .To = recipient 
  28.         .CC = "me@email.com"
  29.         .Subject = subject 
  30.         .TextBody = output 
  31.         .Send 
  32.     End With 
  33.  
  34.     Set cdoMessage = Nothing 
  35.     Set cdoConfig = Nothing 
  36. %>
Dec 18 '08 #1
10 5867
surferj
11 New Member
also -i am not quite sure where to post this one... could some one plz help ?
Dec 18 '08 #2
Curtis Rutland
3,256 Recognized Expert Specialist
Is this question a Classic ASP or ASP.NET question? If you don't know, does the file name end with .asp or .aspx?
Dec 18 '08 #3
surferj
11 New Member
file is a .asp file.
Dec 18 '08 #4
Curtis Rutland
3,256 Recognized Expert Specialist
OK, well I'll move your thread to our Classic ASP forum :)

Mod.
Dec 18 '08 #5
surferj
11 New Member
here is the error message i get

error '8004020e'
/xxxxx/xxxxx/CDOTest.asp, line 64
Dec 20 '08 #6
MrMancunian
569 Recognized Expert Contributor
@surferj
Did you already check with MS TechNet? It returns this errorcode as "IDS_INVALID_VI SIBILITY". Does that help you any further?

Steven
Dec 20 '08 #7
surferj
11 New Member
@MrMancunian
Checked in MS Technet and couldnt find anything to help resolve this. I have our server tech working in it as well to see if something is missing on the W2k3 server install. We have tried to re-register cdosys.dll since we thought maybe the libraries did not load correctly but that doesnt seem to work to fix the issue - same error message produced.

Any help is greatly appreciated.
Thanks
Dec 22 '08 #8
Nicodemas
164 Recognized Expert New Member
That problem sounds indicative of no SMTP authentication being passed along. Here is a stripped down version of the code I always use to send CDOSYS .... never fails so long as you input the right variables.

Expand|Select|Wrap|Line Numbers
  1. const cdoBasic = 1 'Use basic (clear-text) authentication
  2. const cdoSendUsingPort = 2
  3.  
  4. dim oMailConfigurations
  5. dim oConfigurationsFields
  6.  
  7. '//-----------------------------------
  8. '// Create message and config. objects
  9. '//-----------------------------------
  10. set oMail = server.createobject("CDO.Message")
  11. set oMailConfigurations = server.createobject("CDO.Configuration")
  12.  
  13. '//----------------------------------------------
  14. '// determine if the component creation failed
  15. '// return false if so with a nice error message
  16. '//----------------------------------------------
  17. if err <> 0 then
  18.  response.write "CDOSYS not installed."
  19.  response.end
  20. end if
  21.  
  22. Set oConfigurationsFields = oMailConfigurations.Fields
  23.  
  24. '//-----------------------------------
  25. '// apply settings to the config object
  26. '//-----------------------------------
  27. with oConfigurationsFields
  28. ' Specify the authentication mechanism to basic (clear-text) authentication.
  29. .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
  30.  
  31. ' The username for authenticating to an SMTP server
  32. .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "YOUR SMTP USERNAME"
  33.  
  34. ' The password used to authenticate to an SMTP server
  35. .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORD FOR SMTP USERNAME ABOVE"
  36.  
  37. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
  38.  
  39. 'Specify mail server
  40. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YOUR_SITE_MAIL_SERVER_ADDRESS"
  41.  
  42. 'Specify the timeout in seconds
  43. .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 12
  44.  
  45. ' The port on which the SMTP service specified by the smtpserver field is listening for connections (typically 25)
  46. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "YOUR_SERVER_SMTP_MAIL_PORT"
  47.  
  48. .Update
  49. end with
  50.  
  51. '//-----------------------------------------
  52. '// Apply the settings to the message object
  53. '//-----------------------------------------
  54. with oMail
  55.  
  56. Set .Configuration = oMailConfigurations
  57. .To = YOUR_VAR
  58. .From = YOUR_VAR
  59. .Cc = YOUR_VAR
  60. .Bcc = YOUR_VAR
  61. .Subject = YOUR_VAR
  62. .replyTo =  YOUR_VAR
  63.  
  64. .TextBody = YOUR_VAR
  65. .HTMLBody = YOUR_VAR
  66.  
  67. .Send
  68. end with
  69.  
Also, are you 100% sure your mail server address is correct in the script?
Dec 25 '08 #9
surferj
11 New Member
@Nicodemas
mail server address is correct - is functioning on alternate W2k3 server environment

I will test out your code to see if the CDO is properly installed.
thanks
Dec 27 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5038
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I double-checked the path to my error log. It is in /var/www/logs/php_error_log Thanks. :) -Wayne Stevenson
7
2132
by: Rajani | last post by:
Hello, dim receiptto receiptto="a2z@yahoo.com" set cdoconfig=CreateObject("CDO.configuration") set cdomsg=CreateObject("CDO.Message") with cdoconfig.Fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
2
91073
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail objects. I was able to run my application fine for roughly 1500 email messages. The next time I tried sending mail, it stopped working with the message: "
4
2579
by: MadeOfRose | last post by:
Hi all i was using cdo object for sending email to a customers. when use win2000 server or windows xp my script works correctly. but not on win2003 server r2. Different thing on my script is i use external smtp server to send my emails. for example, i dont use the iis' virtual smtp server. i assign an another smtp server
5
27161
by: Jay | last post by:
error '80040211' /register.asp, line 71 I receive this error when i attempt to send an email. My code is as follows:
5
2495
by: Nathan Sokalski | last post by:
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send() method. My code contains all of the following: Dim mailmsg As New Mail.MailMessage Mail.SmtpMail.SmtpServer = System.Configuration.ConfigurationSettings.AppSettings("smtpserver") mailmsg.BodyFormat = Mail.MailFormat.Text mailmsg.Subject = "My Subject"
1
2451
by: Vijay | last post by:
Hi, I have a problem to send Mail in ASP. I am using CDO for sending mail. My Server configuration are : Windows Server 2003 Stadndard Edition with R2, Service Pack 2, Microsoft Management Console(MMC) 3.0, Internet Information Service(IIS) 6.0 My ASP Code to send mail are as follows :
6
2000
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
Hi - I have 4 webservers in my webfarm. All Win2k3 web edition. Before yesterday, none of them were service packed. I have now applied SP2 to two of them, and I'm getting a very weird MSDTC error on them now. The error occurs when I attempt a series of SQL statements wrapped in a TransactionScope(). It's executing against a different server, so this is where it's elevated to a distributed transaction.
3
3598
by: graphicssl | last post by:
Okay, so first of all, I'm a designer first and a light coder second (I'm only really trained with HTML and CSS). So I apologize for having to post about something that's probably super-trivial! I'm working on setting up a shopping cart for a one-product web site, and I'm using HTML and CSS, with ASP for the shopping cart. The ASP takes the information from the form on the shopping cart, and formats it in to two e-mails: one for the company...
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.