FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour emailing
Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
emailing
Posted: Wed Jan 20, 2016 05:23 PM

I have been using CDO for emailing but it is becoming problematic since it doesn't seem to support Outlook. Is there something better I can use for emailing with Harbour?

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: emailing
Posted: Wed Jan 20, 2016 06:00 PM
If Outlook is installed, use MAPI. It's the absolute easiest solution.

Code (fw): Select all Collapse
FUNCTION SendMAPIMail2( MailTo, cSndFile, cText, cSubj )
    // Send MAPI mail originates email to the MAPI client
    //  Updated:    8/2/2015 2:16:52 PM
    LOCAL oMail
      DEFINE MAIL oMail ;
         SUBJECT cSubj ;
         TEXT cText ;
         FILES cSndFile, cSndFile ;
         FROM USER ;
         TO MailTo
      ACTIVATE MAIL oMail
RETURN( .t. )
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
Re: emailing
Posted: Thu Jan 21, 2016 03:44 AM

Is it that simple? That code wouldn't compile with my application, but perhaps I need to incorporate the tmail class?

Posts: 85
Joined: Wed Nov 19, 2014 01:04 PM
Re: emailing
Posted: Thu Jan 21, 2016 01:08 PM

Dear dtussman

you need to #include "mail.ch" in your application.

regards
Yunus.

Regards

Yunus



FWH 21.02
Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
Re: emailing
Posted: Thu Jan 21, 2016 05:44 PM

Thank you Yunus, I will try that

David

Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
Re: emailing
Posted: Sat Jan 23, 2016 12:02 AM

Now when I try to email it say "there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Outlook and set it as the default mail client". I have already done that however. This is windows 10 and I am using an older version of Harbour from 2007. Wonder if the fact that MapiSendMail has been supposedly replaced by MapiSendMailW has anything to do with it?

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Re: emailing
Posted: Sun Jan 24, 2016 11:25 PM

This is the best thing I've found and what I use with xHabour/Fivewin. No other software required, compatible with everything. Just include dll with your install.

https://sockettools.com/sockettools-library-edition/

Randal

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: emailing
Posted: Mon Jan 25, 2016 12:24 AM

Friends:

here is an other option

http://www.afterlogic.com/mailbee/objects

Regards

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
Re: emailing
Posted: Mon Jan 25, 2016 05:33 PM

Thanks Randal and Armando. I will try Sockettools first I think. Randal, do you have any snippets of code you could send me showing how you use it with xharbour/Fivewin? Thanks!

Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: emailing
Posted: Mon Jan 25, 2016 05:46 PM

I use the latest FWH. I also have Outlook ( Office 365 ) installed on Windows 10 and it works perfectly. Antonio has provided more recent builds of Harbour for download ( within the past few months ) so upgrading from a 6 year old version might be helpful.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
Re: emailing
Posted: Tue Jan 26, 2016 12:55 AM

Tim, I am going to try your suggestion first. I bought the harbor upgrades back in august but never installed them, guess its time to bite the bullet.

Posts: 102
Joined: Sat Jun 06, 2015 06:57 PM
Re: emailing
Posted: Sun Jan 31, 2016 08:07 PM

Well, I tried MAPI using FWH 1507 and I got it to work if using MAPISendMail( cSubj, cText, , ,,, .t., ,'dtussman@aol.com' ) . However, I want from user to be set to .f. and when I do that it returns an error code of 2.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: emailing
Posted: Mon Feb 01, 2016 09:21 PM

FROM USER should either be a string or null.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: emailing
Posted: Tue Feb 02, 2016 01:49 AM

My bad, I was thinking you were passing the FROM clause. lFromUser is a flag to determine if you want the user to get a dialog box, and yes, it is supposed to be a logical as you have it. I don't know why passing .f. is generating an error. I may well be, as someone else suggested, that you need to install the upgraded xHarbour also.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: emailing
Posted: Thu Feb 04, 2016 04:19 PM
Tim,

I use the latest FWH. I also have Outlook ( Office 365 ) installed on Windows 10 and it works perfectly. Antonio has provided more recent builds of Harbour for download ( within the past few months ) so upgrading from a 6 year old version might be helpful.


David's client is using an SMTP server with TLS security. Can you tell me, is this server automatically installed when you install Outlook (Office 365)?

As I expect you know, FW's email system uses CDO which does not support TSL.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion