Batch MAPI E-mail (OpenInsight Specific)
At 23 JUN 2000 01:30:37PM Mark Plasko wrote:
Some clients are requesting a delinquency notice process that would automatically compile a list of delinquent items held by employees and then would e-mail that list to their supervisors.
Has anyone attempted to do this programatically, without activating a send_mail dialogue window for each e-mail?
The clients will be using Outlook on a NT server.
Mark
At 26 JUN 2000 11:20AM Peter Kassinski wrote:
What is send_mail dialog window? User application for collection parameters for MAPI functions? In this case design into your mail_program all arguments need for MAPISendMail,MAPISendDocuments etc.
At 26 JUN 2000 11:21AM Frank Tomeo wrote:
Mark,
Although we have not implemented anything directly with our clients, some of them have expressed interest in a similar function that you've expressed where a group of people would be auto-emailed "behind the scenes" during regular OI processing. We took the initiative and did some preliminary work to see if it could be done. We did our testing on NT using Outlook on W98 workstations. I believe that Outlook had to be running at the time the email was sent or it would just sit in the outbox until Outlook was started. Also, it is advantages to have DSL or something similar to always have a connection to the internet. I would have to go back and revisit our testing to give you a more complete answer, but here is the code that ended up working for us:
Compile function Send_Email(SendTo, CC, From, Subject, Body)
$Insert APP_INSERTS
$Insert MAPI_EQUATES
Declare subroutine Get_Status
Declare function MAPILogon, MAPISendMail, MAPILogoff
MsgSent=No$
If Assigned(SendTo) else SendTo ="
If Assigned(CC) else CC ="
If Assigned(From) else From ="
If Assigned(Subject) else Subject="
If Assigned(Body) else Body ="
If SendTo GT "" then
If Body GT "" thenIf MAPILogon(Session, @Window, "MS Exchange Settings", "") thenMessage='Message=SubjectMessage=SendToMessage=CCMessage=FromMessage=BodyMessage=IPM."If MAPISendMail(0, @Window, 0, Message) thenMsgSent=Yes$end elseMsgSent=No$endStatus=MAPILogoff(Session, @Window)endendend
Return MsgSent
At 26 JUN 2000 01:27PM Mark Plasko wrote:
Frank, Peter,
Many thanks, especially for the code insights. The development work will be a future project, but it is heartening to know that it is feasible.
Regards,
Mark