473,322 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Error Sending CDO mail using SMTP

Please take a look at the code below. I kept getting the error message:

CDO.Message.1 error '80040213' - The transport failed to connect to the
server.

Win 2003

IIS 6.0

SMTP configured and pointed to Exchange 5.5 server (mailserver)

I would like to get rid of using schemas.microsoft.com services for
configuration parameters. If you have any example of a workign CDO routine,
please point it to me.

Thank you very much.

Bill

'************************************************* ****

'********************

sub sendMail(fromAddr, recipients,subject, body)

Const cdoSendUsingMethod = _

"http://schemas.microsoft.com/cdo/configuration/sendusing"

Const cdoSendUsingPort = 2

Const cdoSMTPServer = _

"http://schemas.microsoft.com/cdo/configuration/smtpserver"

Const cdoSMTPServerPort = _

"http://schemas.microsoft.com/cdo/configuration/smtpserverport"

Const cdoSMTPConnectionTimeout = _

"http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"

Const cdoSMTPAuthenticate = _

"http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"

Const cdoBasic = 1

Const cdoSendUserName = _

"http://schemas.microsoft.com/cdo/configuration/sendusername"

Const cdoSendPassword = _

"http://schemas.microsoft.com/cdo/configuration/sendpassword"

Dim objConfig ' As CDO.Configuration

Dim objMessage ' As CDO.Message

Dim Fields ' As ADODB.Fields

Set objConfig = Server.CreateObject("CDO.Configuration")

Set Fields = objConfig.Fields

With Fields

..Item(cdoSendUsingMethod) = cdoSendUsingPort

..Item(cdoSMTPServer) = "mailserver" ' This is an Exchange server

..Item(cdoSMTPServerPort) = 25

..Item(cdoSMTPConnectionTimeout) = 10

..Item(cdoSMTPAuthenticate) = cdoBasic

..Item(cdoSendUserName) = "userIDr"

..Item(cdoSendPassword) = "password"
..Update

End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage
..To = recipients

..From = fromAddr

..Subject = subject

..HTMLBody = body

..Send

End With

Set Fields = Nothing

Set objMessage = Nothing

Set objConfig = Nothing

end sub
Nov 20 '05 #1
0 1093

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on...
3
by: dgiagio | last post by:
Hi, I'm creating a SMTP application and I would like to hear opinions about error handling. Currently there are two functions that communicate with the remote peer: ssize_t...
7
by: news | last post by:
Recently our mail from our e-commerce site has been rejected by AOL due to an IP block because someone was using our PHP scripts to send spam. Well, I got that fixed. But our legitimate...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
11
by: hazz | last post by:
smtpClient.Send(message) is causing me problems as per specifics in the trace below. Email is sent but not without this error typically upon sending the second email, but sometimes when running...
8
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New...
3
by: Ibrahim. | last post by:
Hello, Im getting the following error when mail is sent from ASP.NET 2.0 website. CDO.Messaging componenet is used for sending mail. " The message was not able to be transmitted to the SMTP...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
6
by: Dave Kelly | last post by:
Sorry for the long post, it is easier to discard information than to have to wait for it to arrive. So here goes: This code worked perfectly when I was an Earthlink customer. Sprint decided...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.