473,387 Members | 1,579 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,387 software developers and data experts.

Issue on send mail by using CDOSYS.DLL

Hi all,

I develop an VB6 program to send email by using CDOSYS.DLL. It works fine as
follow:

Dim iMsg As New CDO.Message
Dim iDsrc As CDO.IDataSource
Set iDsrc = iMsg ' (QueryInterface)
Dim iConf As New CDO.Configuration
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "smtp.myServer.com"
.Item(cdoSMTPServerPort) = "123"
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSMTPUseSSL) = True
.Item(cdoSendUserName) = "user"
.Item(cdoSendPassword) = "password"

.Update
End With

With iMsg
Set .Configuration = iConf
.To = "ot***@myServer.com"
.From = "me@myServer.com"
.Subject = "Testing 123"
.Send
End With
However, when i migrate to VB.NET as follow:
Dim iMsg As New CDO.Message
Dim iConf As New CDO.Configuration
Dim iFlds As ADODB.Fields
Dim oField As ADODB.Field

iFlds = iConf.Fields

Try
oField = iFlds(CDO.CdoConfiguration.cdoSendUsingMethod)
oField.Value = CDO.CdoSendUsing.cdoSendUsingPort
oField = iFlds(CDO.CdoConfiguration.cdoSMTPServer)
oField.Value = "smtp.myServer.com"
oField = iFlds(CDO.CdoSendUsing.cdoSendUsingPort)
oField.Value = 123
oField = iFlds(CDO.CdoConfiguration.cdoSMTPAuthenticate)
oField.Value = CDO.CdoProtocolsAuthentication.cdoBasic
oField = iFlds(CDO.CdoConfiguration.cdoSMTPUseSSL)
oField.Value = True
oField = iFlds(CDO.CdoConfiguration.cdoSendUserName)
oField.Value = "user"
oField = iFlds(CDO.CdoConfiguration.cdoSendPassword)
oField.Value = "password"

iFlds.Update()

iMsg.Configuration = iConf
iMsg.From = "ot***@myServer.com"
iMsg.To = "me@myServer.com"
iMsg.Subject = "Testing 123"
iMsg.Send()
Catch ex As Exception
Console.Write(ex)
Finally
End Try

I've got an error when execute the .Send() method:
System.Runtime.InteropServices.COMException (0x80040213): The transport
failed to connect to the server.
at CDO.MessageClass.Send()
at WindowsApplication1.Form1.Button1_Click(Object sender, EventArgs e)

Both VB6 and VB.NET program are executed on the same XP machine without
exchange or outlook client is installed. I found that the VB.NET program can
be successfully executed on an XP machine WITH an outlook 2003 application
installed.

From MSDN, it seems that CDOSYS.DLL is target for exchange client installed?
is it true? but how come the VB6 program can be executed on XP machine
without exchange or outlook is installed (except outlook express)? Any
suggestion is appreciated!!

Thanks in advance!!
Martin


Oct 31 '06 #1
0 3228

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

Similar topics

0
by: Henrik Bergman | last post by:
Hi all As I subscribe MSDN I got an USB-memory with Microsoft eLearing library. I found an exampell how to send SMTP e-mail using CDO.Message object and CDO.Configuration. But when I try to...
1
by: Dean | last post by:
I am using MailMessage (CDOSYS) to send emails. I would like to turn off the SMTP service (it's on the local machine) and look at the emails in the pickup folder before they get sent out. However,...
4
by: PawelR | last post by:
Hi, everbody. How send e-mail if smtp need authorization. If authorization is not required send email is not problem but I use SmtpMail.Send(myMail) PawelR
5
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address...
5
by: fcetrini | last post by:
Hello to the board, i'm facing this problem and i need some help: with cdosys i'm able to send e-mail from asp using the local exchange server. Now I also have to save the sent mail into the user's...
8
by: Akbur | last post by:
Dear all, I'm having major issues sending an email from my ASP.NET app. I'm getting a "Could not create 'CDO.Message' object". When I did a search for cdosys.dll in \win_location\system32, I...
1
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send...
1
by: worldofrugs | last post by:
I'm hosted on a shared server with Godaddy.com... I have several forms on my website that all use the same ASP file to send out my forms.. It worked fine for a long time, but now the forms send to...
3
by: Prasad | last post by:
Hi all, I had to write a page in ASP which sends an email. I googled and was able to write the following code: <html> <body> <% Set Mail = Server.CreateObject("CDONTS.NewMail") Mail.To =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.