473,809 Members | 2,469 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Configurati on
Dim Flds As ADODB.Fields
Set Flds = iConf.Fields

With Flds
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "smtp.myServer. com"
.Item(cdoSMTPSe rverPort) = "123"
.Item(cdoSMTPCo nnectionTimeout ) = 10 ' quick timeout
.Item(cdoSMTPAu thenticate) = cdoBasic
.Item(cdoSMTPUs eSSL) = True
.Item(cdoSendUs erName) = "user"
.Item(cdoSendPa ssword) = "password"

.Update
End With

With iMsg
Set .Configuration = iConf
.To = "ot***@myServer .com"
.From = "me@myServer.co m"
.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.Configurati on
Dim iFlds As ADODB.Fields
Dim oField As ADODB.Field

iFlds = iConf.Fields

Try
oField = iFlds(CDO.CdoCo nfiguration.cdo SendUsingMethod )
oField.Value = CDO.CdoSendUsin g.cdoSendUsingP ort
oField = iFlds(CDO.CdoCo nfiguration.cdo SMTPServer)
oField.Value = "smtp.myServer. com"
oField = iFlds(CDO.CdoSe ndUsing.cdoSend UsingPort)
oField.Value = 123
oField = iFlds(CDO.CdoCo nfiguration.cdo SMTPAuthenticat e)
oField.Value = CDO.CdoProtocol sAuthentication .cdoBasic
oField = iFlds(CDO.CdoCo nfiguration.cdo SMTPUseSSL)
oField.Value = True
oField = iFlds(CDO.CdoCo nfiguration.cdo SendUserName)
oField.Value = "user"
oField = iFlds(CDO.CdoCo nfiguration.cdo SendPassword)
oField.Value = "password"

iFlds.Update()

iMsg.Configurat ion = iConf
iMsg.From = "ot***@myServer .com"
iMsg.To = "me@myServer.co m"
iMsg.Subject = "Testing 123"
iMsg.Send()
Catch ex As Exception
Console.Write(e x)
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.MessageClas s.Send()
at WindowsApplicat ion1.Form1.Butt on1_Click(Objec t 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 3264

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

Similar topics

0
1451
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 send it, it answers, "The transport failed to connect to server". I suppose that means the SMTP-server. Since I used that SMTP-server several times when I send e-mail, I can't figure out why I
1
3719
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, since it is connecting using the port, I will get an error if I turn off the SMTP service. I need to configure it so that it writes the emails to the pickup folder. I've done quite a bit of digging, and found some references to...
4
3805
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
8798
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 with this code: MailMessage msgMail = new MailMessage(); msgMail.To = "test@address.com"; msgMail.From = "from@address.com"; msgMail.Subject = "Mail Example Subject";
5
4302
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 mailbox for future reference: how to??? i'm using: ..Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = ServerName ..Fields("http://schemas.microsoft.com/cdo/configuration/
8
7552
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 could not find it. So I copied it from another Windows 2003 server, where it did exist. Another dependant file was missing too (inetcomm.dll).
1
6862
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 mail externally to a internet email site like Gmail the PDF is sent but is corrupted because CDOSYS ends up using binary encoding rather than Base64 encoding when creating the attachment. More information here: Anthonys Code My knowledge of ASP...
1
1380
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 my e-mail arrive after a few hours instead of instantly. Calling Godaddy did not help as they stated all is working fine (no delays) on their end and refuse to help with custom scripts.. My emails are also hosted by godaddy like my website. ...
3
3467
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 = "XXXXXXXXXXXX@XXXXXX.COM"
0
9603
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
10643
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10121
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...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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
5550
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.