UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Sending an email from an app

Forums > SwiftUI

Hi there, i'd like the user to send an eamil from the app and I found this nice package on Github and it works as long as mail.app is installed.

https://github.com/globulus/swiftui-mail-view

What is mail.app is not installed, is it possible to send an email from the app in those circumstances?

Thank you!

1      

Depends on if the user sends the email or you as developer. If the Mail.app isn't installed you need somehow mail server data and credentials.

Many email providers offer besides IMAP also smtp. You can search for it for your email provider. But as I said, the user has to enter the settings in your app.

1      

Hi @flaneur7508

I think you will find that it to do with if the device has the Mail app. So this will not work on the simulator as it does not have a Mail app but should work on real device.

1      

Try using a mailto: URL. That should use the user's default mail app, regardless of whether it is the built-in Mail.app or something else.

1      

thanks guys. @roosterboy I will check that but I dont hold out much hope. cheers! @Nigelgee, yep I discovered that pretty quickly :) all the best folks!

1      

Hacking with Swift is sponsored by RevenueCat

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.