Send attachments via mapi

Send attachments via mapi

Postby Marco Turco » Wed Jun 11, 2014 1:01 pm

Hi all,
do you have a working sample to send emails with attachments using mapi ?
I made this sample but I receive the email without the attachment.

function DirectMessage()

local oMail

AFILES:={}
AADD(AFILES,"K:\FWH\SAMPLES\TESTMAIL.PRG")

DEFINE MAIL oMail ;
SUBJECT "FiveWin Mail-control power" ;
TEXT "This is real xBase power at your fingertips!" ;
TO "xxx@test.co.uk";
FILES AFILES

ACTIVATE MAIL oMail

MsgInfo( oMail:nRetCode )

return nil
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Send attachments via mapi

Postby Marc Vanzegbroeck » Wed Jun 11, 2014 1:42 pm

Marco,

Try
Code: Select all  Expand view
DEFINE MAIL oMail ;
SUBJECT "FiveWin Mail-control power" ;
TEXT "This is real xBase power at your fingertips!" ;
TO "xxx@test.co.uk";
FILES "K:\FWH\SAMPLES\TESTMAIL.PRG","TESTMAIL.PRG"

ACTIVATE MAIL oMail
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1157
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Send attachments via mapi

Postby James Bott » Wed Jun 11, 2014 1:44 pm

Marco,

I don't see anything wrong with your test. Maybe you had the attachment open in an editor? Also try a ZIP file, maybe the server doesn't recognize the extension.

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

Re: Send attachments via mapi

Postby TimStone » Wed Jun 11, 2014 11:05 pm

This has been working fine for me:

FUNCTION SendMAPIMail2( MailTo, cSndFile, cText, cSubj )
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
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Send attachments via mapi

Postby Marco Turco » Fri Jun 13, 2014 8:31 am

Hi all,
thank you for the support.
Anyway I solved using the MapiSendMail function and it runs well.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], karinha and 106 guests