FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Sending e-mail with CDO and SSL
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sending e-mail with CDO and SSL
Posted: Thu Apr 04, 2013 02:20 PM

Rick,

Well it is a crude start. It has no input format checking which is what turned out to be Tim's problem.

As, Enrico pointed out, you may get random errors preventing mail from being sent. I posted a sample loop on error solution in another thread. viewtopic.php?f=3&t=25614&p=142536#p142536

If you are sending multiple emails in one session, the above code starts and ends the connection with each email. It would be better to separate the connection from the sending. This will be much faster for multiple emails.

I also don't like Tim's data array. It would be much better to use an object.

Those are just a few ideas for improvement.

I am working on a CDO class.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Sending e-mail with CDO and SSL
Posted: Thu Apr 04, 2013 07:10 PM

James

I share Tim's frustration with sending mail .. If CDO can be made to work, there would be no need to rely on SMTP and it seems no one sets up SMTP the same way and with too many variables.

With the advent of so many spam e-mail's it seems SMTP will soon be a protocol of the past or relegated to a corporate transport behind a company's firewall.

I would be very grateful if you could simplify the Code ..

Rick Lipkin

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sending e-mail with CDO and SSL
Posted: Thu Apr 04, 2013 07:21 PM

Rick,

Maybe I should clarify.

CDO is a layer above MAPI, i.e. CDO uses MAPI to send emails. And they are sent using a remote SMTP server or a local mail server.

CDO has the advantage over FW's TSMTP class in that it handles SSL.

Or, maybe you already knew all that.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Sending e-mail with CDO and SSL
Posted: Thu Apr 04, 2013 07:46 PM

James

Thank you for the SMTP clarification .. You are correct about the e-mail Host and a few months back I did try CDO to connect to Hot Mail and it appears that Microsoft is not allowing SMTP traffic to be sent unless you are a paying customer??

Google appeared to work .. I did not try Yahoo.

Thanks
Rick Lipkin

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sending e-mail with CDO and SSL
Posted: Thu Apr 04, 2013 08:33 PM

Rick,

Yes, I have gmail working. Yahoo is the one that requires a paid account--I don't believe there is a paid Hotmail account.

I have not been able to connect to Hotmail (now Outlook.com) either. I am using the same parameters I use with Outlook Express, and I can get a connection but the mails are not sent. Since there is only a generic error, I have no idea why it isn't working. I have tried every variation of parameters I can think of also with no luck.

I also have a now discontinued program "SMTP Diagnostics" and it can't send using Hotmail either, nor is it giving me any meaningful errors.

....................
SMTP Diagnostics Report
Trial version. Visit http://www.smtpdiagnostics.com/ for more information.
4/4/2013 1:31:11 PM
Elapse time: 0:00:00.701
....................
[0:00:00.051] Connecting to mail server.
[0:00:00.110] Connected.
[0:00:00.090] 220 BLU0-SMTP147.phx.gbl Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Thu, 4 Apr 2013 13:31:12 -0700
[0:00:00.000] EHLO Matrix
[0:00:00.090] 250-BLU0-SMTP147.phx.gbl Hello [68.7.204.149]
[0:00:00.000] 250-TURN
[0:00:00.000] 250-SIZE 41943040
[0:00:00.000] 250-ETRN
[0:00:00.000] 250-PIPELINING
[0:00:00.000] 250-DSN
[0:00:00.000] 250-ENHANCEDSTATUSCODES
[0:00:00.000] 250-8bitmime
[0:00:00.000] 250-BINARYMIME
[0:00:00.000] 250-CHUNKING
[0:00:00.000] 250-VRFY
[0:00:00.000] 250-TLS
[0:00:00.000] 250-STARTTLS
[0:00:00.000] 250 OK
[0:00:00.000] AUTH LOGIN
[0:00:00.090] 530 5.7.0 Must issue a STARTTLS command first
[0:00:00.000] 161: 530 5.7.0 Must issue a STARTTLS command first
[0:00:00.010] QUIT
[0:00:00.100] 221 2.0.0 BLU0-SMTP147.phx.gbl Service closing transmission channel
[0:00:00.000] Disconnected.
....................

I have also just spent a couple of hours trying to find more info on detecting specific CDO errors, but without any success.

I did stumble upon using xbrowse( oErrorMsg ) to see all the properties of the error object, but it wasn't much help.

I also successfully sent email using my very old Compuserve mail which is now AOL.

It's a challenge.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Sending e-mail with CDO and SSL
Posted: Thu Apr 04, 2013 08:49 PM

Upon re-examining the above output by SMTP Diagnostics, it appears that it is not actually getting a connection to the server. When I run the CDO program it doesn't error out at the connection, but rather at the sending. More mysteries...

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Sending e-mail with CDO and SSL
Posted: Fri Apr 05, 2013 12:41 PM

James

I ran into the same 'brick wall' when it came to Hotmail and now Outlook .. CDO just would not connect and the SMTP parameters I found for the connectivity .. just never worked.

I believe Microsoft just shut the door on granting any 3rd party SMTP traffic due to spammers .. I gave up :(

Hope you find a solution!

Rick Lipkin

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending e-mail with CDO and SSL
Posted: Fri Apr 05, 2013 03:05 PM
Rick,

this is not the problem I'm facing. I repeat: what I'm getting is an erratic behavior on identical sending operation. So the cause can't be "closed doors" or "brick walls". I'm still waiting the response from my clients after James "SysRefresh()" suggestion, that I consider a more likely cause.

EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending e-mail with CDO and SSL
Posted: Tue Apr 09, 2013 05:45 PM

Unfortunately, it seems that the "SysRefresh()" suggestion didn't solve the problem. :-(

I'll try using the other James suggestion, the "retry" one. :-)

EMG

Posts: 7
Joined: Sat Jan 28, 2017 05:08 AM
Re: Sending e-mail with CDO and SSL
Posted: Thu Feb 22, 2018 08:42 PM

Alguien ha encontrado alguna forma de enviar correos desde Hotmail usando starttls con el puerto 587
Se puede desde javamail pero quisiera saber si existe alguna forma desde fivewin

Continue the discussion