FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Email with Attachments
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Email with Attachments
Posted: Tue May 01, 2007 01:17 PM
IF FILE( DEFPATH() + cFile )
      DEFINE MAIL oMail SUBJECT cSubject ;
             TEXT cBody ;
             TO cName , cEmail ;
             FILES DEFPATH() + cFile, cFilename ;
             FROM USER
      ACTIVATE MAIL oMail
ELSE
      ? DEFPATH() + cFile+" not found"
ENDIF


Can I use this command (or class) with arrays aFile instead of cFile and cFilename and aRecipients instead of cName and cEmail.

I need to send multiple emails and/or files to my procedure.
Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 97
Joined: Sun Nov 20, 2005 04:32 PM
Re: Email with Attachments
Posted: Tue May 01, 2007 01:55 PM
Ollie wrote:
IF FILE( DEFPATH() + cFile )
      DEFINE MAIL oMail SUBJECT cSubject ;
             TEXT cBody ;
             TO cName , cEmail ;
             FILES DEFPATH() + cFile, cFilename ;
             FROM USER
      ACTIVATE MAIL oMail
ELSE
      ? DEFPATH() + cFile+" not found"
ENDIF


Can I use this command (or class) with arrays aFile instead of cFile and cFilename and aRecipients instead of cName and cEmail.

I need to send multiple emails and/or files to my procedure.


Hello Ollie,

use this sample:
     aadd(aFiles,{file_with_path, only_filename})
     aadd(aFiles,{file_with_path, only_filename})
     aadd(aFiles,{file_with_path, only_filename})
REM Example: aadd(aFiles,{"C:\TEMP\FILE1.ZIP", "FILE1.ZIP"})
REM Example: aadd(aFiles,{"C:\TEMP\FILE2.ZIP", "FILE2.ZIP"})
      IF Len( aFiles ) > 0
         oMail:aFiles := aFiles
      ENDIF
      ACTIVATE MAIL oMail


Regards, Norbert

Continue the discussion