Contents

setMessageBody(_:isHTML:)

Sets the initial body text to include in the email.

Declaration

func setMessageBody(_ body: String, isHTML: Bool)

Parameters

  • body:

    The initial body text of the message. The text is interpreted as either plain text or HTML, depending on the value of the isHTML parameter.

  • isHTML:

    Specify True if the body parameter contains HTML content or specify False if it contains plain text.

Discussion

This method replaces the previous body content with the new content. If the user has a signature file, the body content is inserted immediately before the signature. If you want to include images with your content, you must attach the images separately using the addAttachmentData(_:mimeType:fileName:) method.

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