Example: mapi_send_mail MS Exchange Server Functions (MAPI)

Sends a MAPI mail message.

int mapi_send_mail( char *transaction, char *To, [char *CC,] [char *BCC,]
[char *Subject,] [char *Type,] [char *Body,] [ATTACHMENTS,] LAST );
transaction A transaction name for this step in quotes. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
To The name of the mail recipient(s) in the format: "To=email_address1, email_address2, . . ."
CC The name of the CC recipient(s) in the format: "CC=email_address1, email_address2, . . .".
BCC The name of the blind recipient(s),BCC, in the format: "BCC=email_address1", "email_address2", . . .
Subject The subject of the mail in the following format: "Subject=my_subject"
Type The type of mail message: "Type=mail_type"
Body The mail content in the following format: "Body=xyz abc..."
ATTACHMENTS The files to be attached to the mail message in the following format: "ATTACHMENTS",
        "File=path1\file1", [Position=
pos1,] "ENDITEM",
        "File=path2\file2", [Position=
pos2,] "ENDITEM"Position indicates the character offset within the body of the message. Postion=5 places the attachment after 5 characters.
LAST A marker indicating the end of the argument list.

The mapi_send_mail function sends a mail message using the MAPI server.

If attachments are specified and they are not found, the mail is not sent.

This function is for use with global sessions. For multiple sessions, use the mapi_send_mail_ex function, which allows you to specify a session identifier.

Return Values

If this function succeeds, it returns LR_PASS. Otherwise, it returns LR_FAIL.


All arguments of this function of the type char, can be parameterized with standard parameterization.