Hello,
Welcome to our Microsoft Q&A platform!
Xamarin.Essentials: Email enables an application to open the default email application, Xamarin.Essentials use Platform.AppContext.StartActivity(intent); to open email application
Here is Xamarin.Essentials: Email source code. Please check it
You can try to use System.Net.Mail.MailMessage to send the email by SMTP( SMTP provides a set of protocols that simplifies the communication of email messages between email servers. ) in the background without to open the email application.
You can try to this Example code of System.Net.Mail.MailMessage
in your project.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi Leon
Sorry, I tried coping and trying to first getting a clean compile, but have got errors:
I have included
Intellisense suggested I also include
But that does not correct the errors either.
What am I missing?
Thank you for your assistance.
Why you create a new class called
MailMessage
? No need to create a new class calledMailMessage
,MailMessage
andSmtpClient
come fromSystem.Net.Mail
. You can put this part of code to Button Click event for testing.Thanks Leon
You are welcome.
Sign in to comment