MS Exchange Server Functions (MAPI) > Alphabetical List of Functions > mapi_send_mail_ex


Example: mapi_send_mail_ex MS Exchange Server Functions (MAPI)

Sends an MAPI mail message for a specific session.

int mapi_send_mail_ex( MAPI *ppmapi, char *transaction, char *To, [char *CC,] [char *BCC,] [char *Subject,] [char *Type,] [char *Body,] [ATTACHMENTS,] LAST );
ppmapi A session identifier.
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_ex function sends a mail message using the MAPI server for the specified session.

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

This function is for use with multiple sessions. For global sessions, use the mapi_send_mail function, which leaves out the 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.