#define MAPI_ORIG 0#define MAPI_TO 1#define MAPI_CC 2#define MAPI_BCC 3#define IMPORTANCE_LOW 0#define IMPORTANCE_NORMAL 1#define IMPORTANCE_HIGH 2CLEARLOCAL lcHTML, lcRTFSET LIBRARY TO LOCFILE("vfpexmapi.fll")******************************!* Send HTML Email*****************************TEXT TO m.lcHTML NOSHOW<html><body><p>Here's an HTML email.</p><ul><li>The</li><li><a href="http://www.sweetpotatosoftware.com/SPSBlog/">SPS Weblog</a></li><li>is Back.</li></ul><p>Visual FoxPro Rocks!</p></body></html>ENDTEXT??"Sending HTML Email"?EMCreateMessageEx("HTML Test", m.lcHTML, IMPORTANCE_HIGH)?EMAddRecipient("someone@somedomain.com", MAPI_TO)?EMSend()******************************!* Send RTF Email*****************************TEXT TO m.lcRTF NOSHOW{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pardHere is a {\b Rich Text Format} email.\par}ENDTEXT??"Sending RTF Email"?EMCreateMessageEx("RTF Test", m.lcRTF, IMPORTANCE_LOW)?EMAddRecipient("someone@somedomain.com", MAPI_TO)?EMSend()
Function EMCreateMessageEx()
Signature: EMCreateMessageEx(cSubject, cHtmlOrRtfBody, nImportance)
Parameters:
cSubject - subject line of the email
cHtmlOrRtfBody - body of the email formatted in HTML or RTF
nImportance - level of importance for the email - valid values for this parameter are as follows:
0 = Low Importance1 = Normal Importance2 = High Importance
Return Value:
Logical - indicating whether the message was successfully created - .T. for success and .F. for failure
Remarks:
This function creates the email message that is going to be sent and should be called first before adding recipients and/or attachments. This function is an advanced version of EMCreateMessage providing for either HTML or RTF within the body of the email. Ensure that the cHtmlOrRtfBody parameter contains complete HTML or RTF as shown in the example above. In short, the opening and closing tags are required as they are used to determine what format was used for the body.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u