I have 3 problems concerning sending emails.
1. To send emails in my application, I use this code :
----------------------------------------------
MapiLogOn()
DEFINE MAIL oOutMail ;
SUBJECT ALLTRIM(EmOnde) ;
FILES TabAtt,"" ;
TEXT FmText FROM USER
oOutMail:aRecipients := {{ALLTRIM(LOWER(cEmail[i])),""}}
ACTIVATE MAIL oOutMail
RC := oOutMail:nRetCode
MapiLogOff()
----------------------------------------------
My email is transferred to Outlook which shows my email once again. After I have clicked "Send", my application gets a GPF while executing "MapiLogOff()". And, of course, my application is quited.
This code worked very good in FW16. Why doesn't it in FW32 ?
Does anyone know why this is happening ?
2. I have another method to send my emails : smpt.
Herefor, I use this code :
----------------------------------------------
oDummy := TSmtp():New(GetHostByName(PAR->POUTLIP))
oOutMail := TSmtp():New(GetHostByName(PAR->POUTLIP))
oOutMail:bConnecting = {|| cStat1:= "Connecting",Em2Dlg:Update() }
oOutMail:bConnected = {|| cStat2:= "Connected",Em2Dlg:Update() }
oOutMail:bDone = {|| EmSend := .T.}
oOutMail:SendMail(ALLTRIM(US->UOUTLADR),;
{ALLTRIM(LOWER(cEmail))},FmText,;
ALLTRIM(EmOnde),TabAttach)
----------------------------------------------
TabAttach is the array which contains the attachments.
There are no problems with sending my emails. But the recipient can't read the attachments. They are transferred to files like ATT00011.TXT or ATT00017.TXT while the original attachments were DOC-files or PDF-files.
What has to be done so that attachments arrive at the recipients as they were send ?
3. How can I send emails from my application to Outlook, using OLE ?
Thank you very much for any help.
Michel
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
