Email with Attachments

Email with Attachments

Postby Ollie » Tue May 01, 2007 1:17 pm

Code: Select all  Expand view
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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Re: Email with Attachments

Postby NK » Tue May 01, 2007 1:55 pm

Ollie wrote:
Code: Select all  Expand view
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:
Code: Select all  Expand view
     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
User avatar
NK
 
Posts: 97
Joined: Sun Nov 20, 2005 4:32 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 69 guests