FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Microsoft Outlook 2003
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Microsoft Outlook 2003
Posted: Sat Apr 24, 2010 12:12 PM

How I can send email and attack from my application into Outlook 2003 ?
Any test sample ?
tks

FWH .. BC582.. xharbour
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Microsoft Outlook 2003
Posted: Sat Apr 24, 2010 08:49 PM
If I understand your question you want to send email via outlook. This code sends me an error.log whrn my client gets an error. From his email to mine.


Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "mail.ch"

 local oMail,aCustomer:={} 
   local cSubject:="Error file" 
   local cWhich     
   local curDir  := curDir()    
   local curDri  := curDrive()  
   local cMessage:="" 
   local aFiles  := {}  
   local cName  
   local cEntity, cName2, cTele,oGet1,oGet2,oDlg3
   local cDemo  


   DEFINE FONT oFont7 NAME "Ms Sans Serif" SIZE 0,-12
   DEFINE DIALOG ODLG3 RESOURCE "errmess" font ofont7

   REDEFINE get oGet1 var cName2 ID 4003 OF oDlg3
   REDEFINE get oGet2 var cTele  ID 4004 OF oDlg3 picture "999-999-9999"
   REDEFINE BUTTON ID 4002 OF oDlg3 ACTION (odlg3:end())    

   ACTIVATE DIALOG oDlg3 centered

   cWhich := curdri+":\"+curDir+"\"+"error.txt"         

   aFiles:={"cWhich","Error.txt"} 

   aadd(aCustomer,"<!-- e --><a href="mailto:support@upyourcashflow.com">support@upyourcashflow.com</a><!-- e -->") 

   DEFINE MAIL oMail  ; 
   SUBJECT cSubject   ; 
     TEXT  allTrim(cName)+CRLF+DTOC(DATE())+" "+TIME()+CRLF+"Version xt2009-10, date: "+cVersion+" "+cDemo+CRLF+; 
                 alltrim(cName2)+" "+cTele ;
     FILES curdri+":\"+curDir+"\"+"error.txt","Error.txt"   ;
     TO "<!-- e --><a href="mailto:support@upyourcashflow.com">support@upyourcashflow.com</a><!-- e -->"

   ACTIVATE MAIL oMail 

  msgInfo("Notice sent  ")
Thank you

Harvey
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Microsoft Outlook 2003
Posted: Sun Apr 25, 2010 09:50 AM
This is a working sample:

Code (fw): Select all Collapse
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oMail

    LOCAL cRec := "Enrico Maria Giordano"
    LOCAL cEma := "e.m.giordano@emagsoftware.it"
    LOCAL cSub := "Test"
    LOCAL cAtt := CURDRIVE() + "\:" + CURDIR() + "\TEST.PRG"

    DEFINE MAIL oMail;
           SUBJECT cSub;
           TEXT "This is a test";
           FROM USER;
           FILES cAtt, ""

    oMail:aRecipients = { { cRec, cEma } }

    ACTIVATE MAIL oMail

    RETURN NIL


EMG
Posts: 401
Joined: Tue Jan 05, 2010 02:33 PM
Re: Microsoft Outlook 2003
Posted: Sun Apr 25, 2010 03:46 PM

Thanks Emg

FWH .. BC582.. xharbour

Continue the discussion