Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Laumching Oulook & Attaching a file to email from VFP
Message
 
 
To
19/11/2001 17:25:55
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00583326
Message ID:
00584746
Views:
53
>Evan,
>
>The ocde works fine, just a couple of points:
>
>1. When running it a popup appears saying "another program is trying to send an email" etc. Is there anyway of stopping this.
>
>2. I need the email to be sent to several recipients. I have tried copying the code with different addresses each time which works fine but the "another program" popup appears each tim the send command is read.
>
>Have you any suggestions re multiple addressees for the same email?
>
>Thank you

Evan,
This may help
PROCEDURE SayErrFile
    cGenericMess="Errors Occured and Reported in ERR_RPT.TXT"
    IF cTYPE= "C"  && If Testing
        @ 7,35 SAY  "*"
    ENDIF    
    IF nERRCNT > 0 
        loWSH=CreateObject("Wscript.Shell")    && Eliminate DOS Window Flash!
        loWSH.run("command /c net send netloginname &cGenericMess ",0,1)
        loWSH=NULL
        ON ERROR QUIT && Email routine Added 10/30/2001 ELB
        oApp=CreateObject("Outlook.Application")
        NameSpace= oApp.GetNameSpace("MAPI")
        MailItem = oApp.CreateItem(0)
        cAutoSubject= "Automatic Err Notification!"
        With MailItem
            .Subject =  cAutoSubject
            .body= CHR(10)+" Today "+TTOC(DATETIME( ))+ CHR(10)+CHR(13);
               +cemailline1+ CHR(13);
               +cemailline2+ CHR(13);
               +cemailline3+ CHR(13);
               +cemailline4+ CHR(13);
               +cemailline5+ CHR(13);
               +cemailline6+ CHR(13);
               +cemailline7+ CHR(13)
            .Recipients.Add ("name1@place.com")
            .Recipients.Add ("name2@aplace.com")
            .Recipients.Add ("name3@arplace.com")
            .Recipients.Add ("name4@arplace.com")
            .Send
        EndWith
        NameSpace.Logoff
    ENDIF
    IF SubStr(cDestFolder,1,1)= "C"     && ERR WHILE Testing SHOW ME
        MODIFY FILE I:\BBS\DATA\CLAIMS\NSF\ERR_RPT.TXT               && debug code
    ENDIF
ENDPROC
Just Add your file attach line ...
Edgar L. Bolton, B.S. B.B.A.
Previous
Reply
Map
View

Click here to load this message in the networking platform