Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
E-mail from foxpro
Message
From
01/12/1998 16:57:54
 
 
To
01/12/1998 16:43:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00162017
Message ID:
00162991
Views:
21
I have an app that sends some 450 emails all with files attached. I use the MAPI Session and MAPI Message ActiveX controls to access the email client on whatever machine I'm running from to send them.

I dropped the Session and Message controls onto a container class, along with a timer. When the user selects "Send Email" the timer interval is set to != 0 so that the timer event will fire. ** The first line of the timer event resets the interval to 0 so that the timer won't try to start the timer event again**

The Timer Event scans through a control table listing the emails it is supposed to send. (This table is built by the process control object while the report files are being generated) It verifies the recipient's email address, assembles the email and sends it on it's way.

As I said, it process some 450 emails each week in about 10 seconds. It takes longer than that for the email client to ship them on their way. The code to assemble and send the email is shown below.

******************************************************************************
If This.Parent.VerifyAddr(EMDAT.Contact_Email) = 1
With This.Parent.oleMAPIMsg
.MsgIndex = -1
.RecipDisplayName = EMDAT.Contact_Email
.MsgSubject = "Publisher Book Reporting For : " + EMCTRL.Ctrl_ID
.MsgNoteText = This.Parent.MsgTxt()
.AttachmentName = Alltrim(EMCTRL.AttchFl)
.AttachmentPathName = Alltrim(EMCTRL.AttchPth)
.AttachmentPosition = 1
.SessionID = This.Parent.oleMAPISession.SessionID
.Send(0)
EndWith
Select EMCTRL
lnCurRec = Recno()
If Rlock()
Replace EMCTRL.Sent With DateTime()
Endif
Unlock Record lnCurRec In EMCTRL
This.Parent.OnErr(3) && Successful Send
Else
This.Parent.OnErr(2)
Endif

*****************************************************************************

Regards,

Jason Tryon
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage
Previous
Reply
Map
View

Click here to load this message in the networking platform