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?
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?
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. )Is it that simple? That code wouldn't compile with my application, but perhaps I need to incorporate the tmail class?
Dear dtussman
you need to #include "mail.ch" in your application.
regards
Yunus.
Thank you Yunus, I will try that
David
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?
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
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!
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, 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.
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.
FROM USER should either be a string or null.
James
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
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.