Contents

setToRecipients(_:)

Sets the initial recipients to include in the email’s To field.

Declaration

func setToRecipients(_ toRecipients: [String]?)

Parameters

  • toRecipients:

    An array of String objects, each containing the email address of a single recipient.

Discussion

This method replaces the previous recipients with the new ones listed in the toRecipients parameter. This method doesn’t filter out duplicate email addresses, so if duplicates are present, multiple copies of the email message may be sent to the same address.

Only call this method before you display the mail composition interface. Don’t call it after presenting the interface to the user.

See Also

Setting mail fields programmatically