<< Click to Display Table of Contents >> Navigation: Reference > MailMessage > AddRecipient Method |
AddRecipient method adds recipient to the To field of e-mail message.
Syntax
[Visual Basic]
Sub AddRecipient(objMailAddress As AddEmailLib.MailAddress)
Example:
Dim objMailAddress As New AddEmailLib.MailAddress
objMailAddress.Address = "someone@someisp.com"
objMailMessage.AddRecipient objMailAddress
[VBScript]
Sub AddRecipient(objMailAddress)
Example:
Dim objMailAddress
Set objMailAddress = CreateObject("AddEmail.MailAddress")
objMailAddress.Address = "someone@someisp.com"
objMailMessage.AddRecipient objMailAddress
[C#]
void AddRecipient(AddEmailLib.MailAddressClass objMailAddress);
Example:
AddEmailLib.MailAddressClass objMailAddress = new AddEmailLib.MailAddressClass();
objMailAddress.Address = "someone@somesp.com";
objMailMessage.AddRecipient(objMailAddress);
[C++]
HRESULT AddRecipient(IMailAddress* objMailAddress);
Example:
AddEmailLib::IMailAddressPtr spMailAddress;
spMailAddress.CreateInstance(__uuidof(AddEmailLib::MailAddress));
spMailAddress->PutAddress("someone@someisp.com");
spMailMessage->AddRecipient(spMailAddress);
Parameters
objMailAddress [in]
Prepared MailAddress object containing e-mail address and name of the recipient.
Return value
None.
Remarks
Use AddRecipient method to add prepared MailAddress object containing e-mail address and optional name of the recipient of e-mail message. E-mail address and name will appear in the To field of the message. Application can call AddRecipient method more than once to have more than one recipient in the To field.