Email Integration in Mobile Apps
Integrating email into a mobile app has several layers of complexity. You can open the native email client via mailto: and call it integration. You can send transactional emails via SMTP directly from the device—something nobody should do in production. Or you can do it right—through the email provider's API from the server, but with a convenient interface in the app. Over the years, we have accumulated experience with all three approaches and know what pitfalls await on each path. We guarantee a reliable and secure integration that meets App Store and Google Play standards.
Which Integration Method Fits Your Project?
Choosing the integration method depends on the use case. We identify three main ones, each with its own specifics.
Scenario 1: Opening the native client. The simplest. On iOS—MFMailComposeViewController from MessageUI.framework, on Android—Intent.ACTION_SENDTO with Uri.parse("mailto:"). Suitable when you just need to let the user write an email—for support, for example. Pitfall: MFMailComposeViewController is unavailable on the simulator and on devices without a configured mail account. We always check MFMailComposeViewController.canSendMail() before showing it, otherwise a crash. On Android similarly—Intent.resolveActivity().
Scenario 2: Transactional emails via API. Registration, password reset, order notifications—emails are sent from the server, the app only initiates the request. Provider selection:
| Provider | SDK | Free tier |
|---|---|---|
| SendGrid | REST API + official SDK | 100 emails/day |
| Mailgun | REST API | 100 emails/day |
| Amazon SES | AWS SDK | 62k emails/month (inside AWS) |
| Postmark | REST API | No free tier |
The mobile app makes a request to its backend (POST /api/send-email), the backend calls the provider's API. API keys are never stored in the app. This approach is 10 times more secure than sending SMTP from the device and guarantees delivery.
Scenario 3: Reading and sending email in the app interface. A full email client inside the app—this means IMAP/SMTP or Graph API (Outlook) / Gmail API. For Gmail: authorization via OAuth 2.0, fetching email list via users.messages.list, bodies via users.messages.get. Gmail API quotas: 250 units per request, 1 billion units per day per project. Under heavy usage, you need to monitor.
| Criteria | IMAP | Gmail API | Graph API |
|---|---|---|---|
| Complexity | High (session management) | Medium | Medium |
| OAuth | Yes | Yes | Yes |
| Push notifications | Via IMAP IDLE (requires TCP) | Via Pub/Sub | Via webhooks |
| Performance | Network-dependent | Fast (JSON) | Fast (JSON) |
Why Trust Email Integration to Professionals?
Integration done with all nuances in mind saves up to 40% of debugging time. We are a team with extensive experience, having implemented email integration in many projects. We account for platform specifics: on iOS—URLSession and security-scoped bookmarks for attachments, on Android—MediaStore and ACTION_OPEN_DOCUMENT. Without this—access errors and instability.
Working with Attachments
Attachments in the mobile context require caution. On iOS, files from UIDocumentPickerViewController are accessible via security-scoped bookmarks and require explicit calls to startAccessingSecurityScopedResource() / stopAccessingSecurityScopedResource(). Without this, you get NSCocoaErrorDomain with code 257. On Android with API 30+, direct access to /sdcard is closed—only through MediaStore or ACTION_OPEN_DOCUMENT. For downloading attachments from an email—streaming download with progress, URLSession.downloadTask on iOS or OkHttp with ResponseBody.byteStream() on Android. Do not buffer everything in memory if the attachment may be large. We guarantee correct handling of attachments up to 25 MB on both platforms.
Push Notifications for New Emails
For real-time notifications of incoming emails, IMAP IDLE keeps a TCP connection—on mobile this drains the battery 2 times faster. The proper way: the server listens via IMAP IDLE, when a new email arrives, it sends a push via FCM/APNs. The app receives the push, makes a request, and updates the list. We implement this mechanism to ensure low latency without compromising battery life.
What's Included in the Work
When ordering integration, we provide:
- Audit of the current architecture and selection of the optimal method.
- Development and configuration of backend components (API keys, templates, OAuth).
- Integration of the email provider's SDK and push notifications.
- Testing on real devices and simulators.
- Operational documentation and post-launch support.
Timeline estimates: simple transactional email sending integration—2-3 days. Built-in email client with IMAP/OAuth—3 to 6 weeks. Exact cost is calculated individually—contact us for a consultation. Order email integration for your app and get a reliable solution with a guarantee.
Gmail API is the primary tool for working with Google email.







