-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send mail via System.Net.Mail.SmtpClient isn't working on .NET MAUI Android, but on .NET MAUI Windows and Xamarin.Forms Android #74576
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionI've created a small sample trying to send an email using the Reproduction Steps
I've tried using an See the following basic sample: Expected behaviorMail was sent on Android Actual behavior
Regression?The same code is working on Xamarin.Forms for Android and iOS. Known WorkaroundsNo response ConfigurationWhich version of .NET is the code running on? What OS and version, and what distro if applicable? What is the architecture (x64, x86, ARM, ARM64)? Other information
|
I've also create an issue in the .NET MAUI repository: Maybe also related to: |
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsDescriptionI've created a small sample trying to send an email using the Reproduction Steps
I've tried using an See the following basic sample: Expected behaviorMail was sent on Android Actual behavior
Regression?The same code is working on Xamarin.Forms for Android and iOS. Known WorkaroundsNo response ConfigurationWhich version of .NET is the code running on? What OS and version, and what distro if applicable? What is the architecture (x64, x86, ARM, ARM64)? Other information
|
@tsjdev-apps What version of Android / api level are you using? |
I tried to reproduce this problem on my device and the message was successfully sent (Samsung Galaxy S10 Lite, Android 12) |
I have with outlook.com account (really a hotmail account) and it works too, using this data:
EDIT: I forget to delete the port in the set, because I passed it as paramter in the constructor, but I have tried to comment this line and it still work. |
Android 5 should be tested as it is the lowest supported Android version by MAUI |
I've tried now on several real devices and it is working. |
firewall setting....? |
I've done some further testing on emulators with various API levels and encrypted SMTP consistently worked on API levels 28 and newer and failed on 26 and lower. For some reason emulator with API 27 didn't work on my PC today so I couldn't test it. I'm not sure what exactly the problem is, but it seems that the problem is support on lower API levels and not emulator vs. device or firewall settings. |
@simonrozsival |
What Android version? |
I've tested with Android 11 and Android 12. |
Could you test Android 8.1 or lower? |
Unfortunately I don't have access to an Android device running Android 8.1 or lower. |
Description
I've created a small sample trying to send an email using the
System.Net.Mail.SmtpClient
. The sample is working on Windows, but not on Android. AnInterop+AndroidCrypto+SslException
is thrown. The same code is working on Xamarin.Forms for both platforms.Reproduction Steps
System.Net.Mail.SmtpClient
and calling theSendMailAsync()
on AndroidInterop+AndroidCrypto+SslException
is thrownI've tried using an
outlook.com
mail address with thesmtp-mail.outlook.com
host.See the following basic sample:
MauiSendMailSample.zip
Expected behavior
Mail was sent on Android
Actual behavior
Interop+AndroidCrypto+SslException
is thrownRegression?
The same code is working on Xamarin.Forms for Android and iOS.
Known Workarounds
No response
Configuration
Which version of .NET is the code running on?
.NET MAUI Version: 6.0.486 (current)
What OS and version, and what distro if applicable?
Android
What is the architecture (x64, x86, ARM, ARM64)?
ARM, ARM64
Other information
The text was updated successfully, but these errors were encountered: