emailing

Post Reply
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

emailing

Post by dtussman »

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?
User avatar
TimStone
Posts: 2954
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: emailing

Post by TimStone »

If Outlook is installed, use MAPI. It's the absolute easiest solution.

Code: Select all | Expand


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
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

Re: emailing

Post by dtussman »

Is it that simple? That code wouldn't compile with my application, but perhaps I need to incorporate the tmail class?
dagiayunus
Posts: 85
Joined: Wed Nov 19, 2014 1:04 pm
Contact:

Re: emailing

Post by dagiayunus »

Dear dtussman

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

regards
Yunus.
Regards
Yunus

FWH 21.02
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

Re: emailing

Post by dtussman »

Thank you Yunus, I will try that

David
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

Re: emailing

Post by dtussman »

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?
Randal
Posts: 261
Joined: Mon Oct 24, 2005 8:04 pm

Re: emailing

Post by Randal »

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
User avatar
Armando
Posts: 3271
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México
Been thanked: 2 times
Contact:

Re: emailing

Post by Armando »

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
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

Re: emailing

Post by dtussman »

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!
User avatar
TimStone
Posts: 2954
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: emailing

Post by TimStone »

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
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

Re: emailing

Post by dtussman »

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.
dtussman
Posts: 102
Joined: Sat Jun 06, 2015 6:57 pm

Re: emailing

Post by dtussman »

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.
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: emailing

Post by James Bott »

FROM USER should either be a string or null.

James
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: emailing

Post by James Bott »

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

Re: emailing

Post by James Bott »

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
Post Reply