MAPI Mail Syntax:
DEFINE MAIL [ <oMail> ];
[ SUBJECT <cSubject> ];
[ TEXT <cText> ];
[ TYPE <cType> ];
[ DATE <dDate> ];
[ TIME <cTime> ];
[ CONVERSATION <cConversation> ]:
[ RECEIPT ];
[ FROM USER ];
[ FILES <cFilename1> ,<cDescript1>, <cFilenameN>, <cDescriptN> ] ];
[ ORIGIN <cOrigin> [ <cOriginAddress> ] ];
[ TO <cTarget1>, [ <cTargetAddress1> ] [ <cTargetN> [ <cTargetAddressN> ] ] ];
FILES
When specifying an attachment file you must include the path and a description. Use a two dimensonal array, the first element is the filename with path, the second is the description. You can have multiple files by adding more elements.
aFiles:={"c:\my docments\mydoc.doc","mydoc.doc"}
If the attachment file is html (has a .htm or .html extension) and you do not specify any TEXT (a message) then the file will appear in the message area.
For Outlook do it this way:
oMail:HTMLBody = ...
ERRORS
If you specify a TO and the parameter is blank and you are using the FROM USER clause, the message compose box will not appear. Likewise if the filename is invalid or not found. It is best to use an error trap:
- Code: Select all Expand view
DEFINE MAIL...
ACTIVATE MAIL...
IF oMail:nRetCode!=0
MsgAlert("The message could not be sent due to an error."+CRLF+;
"MAPI error code: "+ltrim(str(oMail:nRetCode)),"Alert")
ENDIF