Search Issue Tracker

Fixed in 2018.2

Fixed in 2017.2, 2017.3, 2018.1

Won't Fix in 2017.1

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 (4)

  1. A1e5b063292ecf443677359a8c78ce18?d=mm

    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. Da4b2e4c59abfea6d06aad8a8f8c35b3?d=mm

    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. Da4b2e4c59abfea6d06aad8a8f8c35b3?d=mm

    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. D041c1a821dcbd45473b67a439ce635f?d=mm

    dserebroDXC

    Apr 26, 2018 01:05

    Any chance this is also fixed in 2018.1?

All about bugs

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