<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MessageUI",
  "identifier" : "/documentation/MessageUI/MFMailComposeViewController/setPreferredSendingEmailAddress(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Message UI"
    ],
    "preciseIdentifier" : "c:objc(cs)MFMailComposeViewController(im)setPreferredSendingEmailAddress:"
  },
  "title" : "setPreferredSendingEmailAddress(_:)"
}
-->

# setPreferredSendingEmailAddress(_:)

Sets the preferred email address to use in the From field, if such an address is available.

```
func setPreferredSendingEmailAddress(_ emailAddress: String)
```

## Parameters

`emailAddress`

The preferred email address used to send this message.

## Discussion

If the user doesn’t have an account with a preferred address set up, the default account is used instead.

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)