Sending e-mail with CDO and SSL

Re: Sending e-mail with CDO and SSL

Postby James Bott » Thu Apr 04, 2013 2: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Sending e-mail with CDO and SSL

Postby Rick Lipkin » Thu Apr 04, 2013 7: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Sending e-mail with CDO and SSL

Postby James Bott » Thu Apr 04, 2013 7: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Sending e-mail with CDO and SSL

Postby Rick Lipkin » Thu Apr 04, 2013 7: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Sending e-mail with CDO and SSL

Postby James Bott » Thu Apr 04, 2013 8: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Sending e-mail with CDO and SSL

Postby James Bott » Thu Apr 04, 2013 8: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Sending e-mail with CDO and SSL

Postby Rick Lipkin » 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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Sending e-mail with CDO and SSL

Postby Enrico Maria Giordano » Fri Apr 05, 2013 3: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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending e-mail with CDO and SSL

Postby Enrico Maria Giordano » Tue Apr 09, 2013 5: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
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending e-mail with CDO and SSL

Postby Jilo1234 » Thu Feb 22, 2018 8: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
Jilo1234
 
Posts: 7
Joined: Sat Jan 28, 2017 5:08 am

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests

cron