NEW: My new book Pro SwiftUI is out now – level up your SwiftUI skills today! >>

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!

   

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.

   

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.

   

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.

   

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!

   

Hacking with Swift is sponsored by Essential Developer

SPONSORED From March 20th to 26th, you can join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer!

Click to save your free spot now

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

Reply to this topic…

You need to create an account or log in to reply.

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.