Search Issue Tracker

Fixed in 2018.2.X

Fixed in 2017.2.X, 2017.3.X, 2018.1.X

Won't Fix in 2017.1.X

Votes

0

Found in

2017.1.0p5

Issue ID

947208

Regression

No

[IL2CPP] [.NET 4.6] Mail doesn't send when calling SmtpClient.Send

IL2CPP

-

Reproduction steps:
1. Allow less secure apps to access your email account.
- Google guide: https://support.google.com/accounts/answer/6010255?hl=en
- Unity account may not be viable for security reasons (Tested with personal email).
2. Open the attached project.
3. Open EmailTestingScript.cs
4. Fill 'TODO' sections.
- Tested with smtp.gmail.com host and 587 port.
5. Play the Main scene.
- Success message will show.
6. Make sure Scripting Backend is set to IL2CPP and Scripting Runtime Version to .NET 4.6 in iOS Build Settings.
7. Build and run in iOS device.
-An email will not send with the following message:
...
System.Net.Mail.SmtpException: Message could not be sent. ---> System.IO.IOException: Connection closed
at System.Net.Mail.SmtpClient.Read () [0x00000] in <00000000000000000000000000000000>:0
at System.Net.Mail.SmtpClient.SendCommand (System.String command) [0x00000] in <00000000000000000000000000000000>:0
at System.Net.Mail.SmtpClient.SendCore (System.Net.Mail.MailMessage message) [0x00000] in <00000000000000000000000000000000>:0
at System.Net.Mail.SmtpClient.SendInternal (System.Net.Mail.MailMessage message) [0x00000] in <00000000000000000000000000000000>:0
at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <00000000000000000000000000000000>:0
at EmailTestingScript.Start () [0x00000] in <00000000000000000000000000000000>:0
--- End of inner exception stack trace ---
at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00000] in <00000000000000000000000000000000>:0
at EmailTestingScript.Start () [0x00000] in <00000000000000000000000000000000>:0
...

Reproduced with:
.Net 4.6
2017.1.1f1, 2017.3.0a7
iPad Mini 2 10.3.1, iPhone 6 Plus 8.0

Not reproducible with:
.Net 3.5
5.6.3p2 (feature was not introduced)

Comments (24)

  1. mcpepa

    Jun 19, 2019 05:04

    I'm still having this problem with 2018.2.21f

    when I build with mono, emails are send and working just fine.
    when I build with IL2CPP email system stop working.

  2. alenwalker007

    Jan 02, 2019 10:11

    I was also facing the same SMTP error which was eventually fixed after visiting https://gmailtechnicalsupportnumbers.com/fix-gmail-error-codes-messages/ since it was a general SMTP server error so you can try checking the site and ask for help.

  3. alenwalker007

    Jan 02, 2019 10:10

    I was also facing the same SMTP error which was eventually fixed after visiting https://gmailtechnicalsupportnumbers.com/fix-gmail-error-codes-messages/ since it was a general SMTP server error so you can try checking the site and ask for help.

  4. dserebroDXC

    Apr 26, 2018 01:05

    Any chance this is also fixed in 2018.1?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.