AddReplyTo

Description

Adds an email address and display name to the "Reply To" field of the email.

Applies to

MimeMessage object

Syntax

mimemessage.AddReplyTo(string replyto{, string displayname})

Argument

Description

mimemessage

A MimeMessage object identifying the email message in which you want to add the ReplyTo email address and display name.

replyto

A string that contains the ReplyTo email address.

displayname (optional)

A string that contains the ReplyTo email display name.


Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is null, the method returns null.

Examples

The following example adds two email addresses to the "Reply To" field, one of which has the email display name.

lnv_SmtpClient.Message.AddReplyTo("Tester1@gmail.com" )
lnv_SmtpClient.Message.AddReplyTo("Tester2@gmail.com", "Tester2Name" )

The following example adds three email addresses to the "Reply To" field.

Integer i
String strReply[3]={"Reply1@gmail.com","Reply2@gmail.com","Reply3@gmail.com"}
FOR i = 1 To UpperBound(strReply)
  li_rc = lnv_SmtpClient.Message.AddReplyTo(strReply[i])
  IF li_rc = -1 THEN
    messagebox("Error","Failed to add the ReplyTo email.")
  END IF
NEXT

See also

AddAttachment

AddBcc

AddCc

AddLinkedResource

AddRecipient

GetSender

Reset

SetSender