AddRecipient Method


Add normal, carbon copy or blind carbon copy recipient to current email.

[Syntax]
Visual C++: HRESULT AddRecipient(BSTR strName, BSTR strAddress, long Flags, long* pVal)
Visual Basic AddRecipient(strName As String, strAddress As String, Flags As Long) As Long

Parameter:

strName

Friendly name of the recipient.

strAddress

Email address of the recipient.

Flags

Value Meaning
0 Normal recipient(To)
1 Carbon copy recipient(Cc)
2 Blind carbon copy recipient(Bcc)

Return Values

Return zero if successful, or return non-zero if failed.

Usage Example:

[Visual Basic]
Dim oSmtp As EASendMailObjLib.Mail
Set oSmtp = New EASendMailObjLib.Mail

' for evaluation usage, please use "TryIt" as the license code.
oSmtp.LicenseCode = "TryIt"

oSmtp.AddRecipient "Dennis", "dennis@msn.com", 0   'normal recipient
oSmtp.AddRecipient "Support Team", "support@adminsystem.net", 1 'cc
oSmtp.AddRecipient "BCC ", "info@adminsystem.net", 2 'bcc

See Also

ClearRecipient Method