<< Click to Display Table of Contents >> VpeAddMailReceiver |
[Windows platform only; not supported by the Community Edition]
Allows you to specify a list of e-mail receivers by code.
void VpeAddMailReceiver(
VpeHandle hDoc,
LPCSTR receiver,
long recip_class
)
VpeHandle hDoc
Document Handle
LPCSTR receiver
the name / e-mail address of the receiver
long recip_class
posssible values are:
Constant Name |
Value |
Comment |
VMAIL_ORIG |
0 |
Recipient is message originator |
VMAIL_TO |
1 |
Recipient is a primary recipient |
VMAIL_CC |
2 |
Recipient is a copy recipient |
VMAIL_BCC |
3 |
Recipient is blind copy recipient |
VMAIL_RESOLVE_NAME |
-2147483648 |
try to resolve the name from the mail client's address book (Simple MAPI only) |
Remarks:
The list of recipients will be valid until VpeClearMailReceivers() is called.
Simple MAPI:
Due to the security features in Outlook 2002 or higher (which can also be installed for earlier Outlook versions as security fix), Outlook will show a warning message that an external application is trying to access the address book, when sending an e-mail. To avoid this, VPE does not call MAPIResolveName() anymore. If you want VPE to look up a name in the mail client's address book, add VMAIL_RESOLVE_NAME to the RecipientClass parameter.
VpeAddMailReceiver(hDoc, "IDEAL Software", VMAIL_TO + VMAIL_RESOLVE_NAME)
Will resolve the receiver to "Support@IdealSoftware.com" if "IDEAL Software" is stored in the address book of the MAPI client as "Support@IdealSoftware.com".
However, if you use this flag - with Outlook 2002 or higher or the security fix installed - this will cause a warning message to appear that an extearnal application is trying to access the address book.
The warning is also shown by Outlook - and can not be avoided - if you sent e-mails without showing a dialog (i.e. MailWithDialog = False).
The warning can be disabled in Outlook with "Options | Security" by unchecking "Show warning if other applications try to send an e-mail under my name".
If you are not using VMAIL_RESOLVE_NAME and you are using Outlook / Exchange, make sure SMTP is properly configured, otherwise an error message might appear that the message could not be delivered.
Please note that VMAIL_RESOLVE_NAME is not supported, if VPE uses Extended MAPI.
Example:
VpeAddMailReceiver(hDoc, "max@alpha.com", VMAIL_CC)
Will add "max@alpha.com" as carbon copy recipient for the same e-mail.
VpeAddMailReceiver(hDoc, "[FAX: +49 1234 12345678]", VMAIL_TO)
Will FAX the message to the given phone number! If a VPE Document is attached to the mail, the VISIBLE CONTENT of the document will be faxed. Requires MS-MAIL and MS-FAX, or a similar MAPI- Mail / Fax software to be installed on the system. Also the VPE Document viewer VPE View (see "VPE View - the Document Viewer" in the Programmer's Manual) needs to be correctly installed, otherwise VPE Document attachments will not be faxed with their visual content.