AddMailReceiver

<< Click to Display Table of Contents >>

Navigation:  E-Mail Functions >

AddMailReceiver

Previous pageReturn to chapter overviewNext page

[Windows platform only; not supported by the Community Edition]

Allows you to specify a list of e-mail receivers by code.

method void VPE.AddMailReceiver(

string Receiver,

RecipientClass [long] RecipientClass

)

string Receiver

the name / e-mail address of the receiver

RecipientClass [long] RecipientClass

posssible values are:

ActiveX / VCL

Value

Enum

Comment

VMAIL_ORIG

0

Orig

Recipient is message originator

VMAIL_TO

1

To

Recipient is a primary recipient

VMAIL_CC

2

Cc

Recipient is a copy recipient

VMAIL_BCC

3

Bcc

Recipient is blind copy recipient

VMAIL_RESOLVE_NAME

-2147483648

ResolveName

try to resolve the name from the mail client's address book (Simple MAPI only)

Remarks:

The list of recipients will be valid until ClearMailReceivers() 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.

E.g. Doc.AddMailReceiver("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 external 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:

ActiveX / VCL:

Doc.AddMailReceiver("max@alpha.com", VMAIL_CC)

 

.NET:

Doc.AddMailReceiver("max@alpha.com", RecipientClass.Cc)

Will add "max@alpha.com" as carbon copy recipient for the same e-mail.

 

ActiveX / VCL:

Doc.AddMailReceiver("[FAX: +49 1234 12345678]", VMAIL_TO)

 

.NET:

Doc.AddMailReceiver("[FAX: +49 1234 12345678]", RecipientClass.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.