Import PT_MCF_MAIL:*;
Local PT_MCF_MAIL:MCFOutboundEmail &email;
Local boolean &done;
Local integer &res;
Function Email_Example(&Email_Address_To As string, &Email_Address_From As
string, &Subject As string,
&BodyText_or_HTML as string, &ContentType as string);
/*
/*
/*
/*
/*
/*
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&Email_Address_To takes standard email format:
myname@[Link] if multiple addresses then
separate by commas
&Email_Address_From takes standard email format:
myname@[Link]
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
*/
*/
*/
*/
*/
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* Instantiate the App Package Class
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
&email = create PT_MCF_MAIL:MCFOutboundEmail();
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* Set Email Object Properties
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
&[Link] = &Email_Address_From;
&[Link] = &Email_Address_To;
&[Link] = &Subject;
&[Link] = &BodyText_or_HTML;
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* Could be "text/plain", "text/html", or
/*
"multipart/alternative"
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&[Link] = &ContentType;
*/
*/
*/
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* Invoke the method to generate the email
*/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
&res = &[Link]();
Evaluate &res
When %ObEmail_Delivered
/* every thing ok */
&done = True;
MessageBox(0, "", 0, 0, "Email Sent Successfully");
Break;
When %ObEmail_NotDelivered
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* Check &[Link], &[Link]
/*
and &[Link]
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&done = False;
*/
*/
*/
*/
MessageBox(0, "", 0, 0, "Email Not delivered" |
&[Link] | &[Link] |
&[Link]);
Break;
When %ObEmail_PartiallyDelivered
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* Check &[Link], &[Link]
/*
and &[Link]
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
*/
*/
*/
&done = True;
MessageBox(0, "", 0, 0, "Email Partially delivered" |
&[Link] | &[Link] |
&[Link]);
Break;
When %ObEmail_FailedBeforeSending
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/* Get the Message Set Number, message number;
/*
Or just get the formatted messages from
/*
&[Link], [Link];
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&done = False;
MessageBox(0, "", 0, 0, "Email Failed Before Sending" |
&[Link] | &[Link]);
Break;
End-Evaluate;
End-Function;
*/
*/
*/
*/
*/