Search code examples
iosinappsettingskit

How to set e-mail address in InAppSettingsKit?


I have set up InAppSettingsKit to send an e-mail like this:

<dict>
    <key>DefaultValue</key>
    <string></string>
    <key>IASKMailComposeToRecipents</key>
    <array/>
    <key>IASKMailComposeBody</key>
    <string></string>
    <key>IASKMailComposeBodyIsHTML</key>
    <string>NO</string>
    <key>IASKMailComposeSubject</key>
    <string>Subject title</string>
    <key>Title</key>
    <string>Title</string>
    <key>Type</key>
    <string>IASKMailComposeSpecifier</string>
</dict>

I have tried different ways to populate the e-mail address in IASKMailComposeToRecipents, but have not found a solution for how to do that.

I thought is would be something like this, but this fails to bring up the e-mail address:

<array><string>[email protected]</string></array>

Any help on this one?


Solution

  • This should work:

    <dict>
        <key>IASKMailComposeToRecipents</key>
        <array>
                <string>[email protected]</string>
        </array>
        <key>IASKMailComposeBody</key>
        <string>body</string>
        <key>IASKMailComposeBodyIsHTML</key>
        <false/>
        <key>IASKMailComposeSubject</key>
        <string>Subject title</string>
        <key>Title</key>
        <string>Title</string>
        <key>Type</key>
        <string>IASKMailComposeSpecifier</string>
    </dict>
    

    Note that the Simulator doesn't support MFMailComposeViewController so make sure to test this on the device.