Connection failure of the library System.Net.Mail in Unity3d, what to do?

Guys please tell me there is a button the c#script:
if(GUI.Button(new Rect(Screen.width / 2 - 264, Screen.height / 2 + 150, 529, 62), "Send"))
{

 Email1 MailAddress = new MailAddress ("What", "From");
 Email2 MailAddress = new MailAddress ("what e-mail", "To");

 using (MailMessage MailMessages = new MailMessage (email1, email2))
 using (SmtpClient smtpClient = new SmtpClient ()) 
{
 MailMessages.Subject = "Log In";
 MailMessages.Body = "Message";

 smtpClient.Host = "smtp.gmail.com";
 smtpClient.Port = 587;
 smtpClient.EnableSsl = true;
 smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
 smtpClient.UseDefaultCredentials = false;
 smtpClient.Credentials = new NetworkCredential(email1.Address, "q1w2e3r4zqxwcevr");

smtpClient.Send(MailMessages);
}

 }

Library all hooked up:
using UnityEngine;
using System.Collections;
using System;
using System.Net;
using System.Net.Mail;

But unity throws the error:
Assets/Scripts/Main.cs(5,18): error CS0234: The type or namespace name `Mail' does not exist in the namespace `System.Net'. Are you missing an assembly reference?
June 10th 19 at 16:03
1 answer
June 10th 19 at 16:05
Try to load using nuget
What is it like? Something looked is not described anywhere! - gregg.Renn commented on June 10th 19 at 16:08
go to tools-nuget package manager -package manager console.In the console type Install-Package System.Net.Mail - leland.Gutkowski commented on June 10th 19 at 16:11
Yeah where is the damn Unity then? - gregg.Renn commented on June 10th 19 at 16:14
And here unity ?.This is done in vs - leland.Gutkowski commented on June 10th 19 at 16:17
I have the standard editor! - gregg.Renn commented on June 10th 19 at 16:20
, www.cyberforum.ru/unity/thread1933259.html - leland.Gutkowski commented on June 10th 19 at 16:23
Yes does not help, everything is connected! For a test tried the library System.Web connect, the same error! - gregg.Renn commented on June 10th 19 at 16:26
Solved the problem... Thanks!
The second appeared:

System.Net.Mail.SmtpClient': type used in a using statement must be implicitly convertible to `System.IDisposable' - gregg.Renn commented on June 10th 19 at 16:29
The problem was solved , just Build stood Platforma browser! Changed to Windows and it worked) - gregg.Renn commented on June 10th 19 at 16:32

Find more questions by tags Unity Game Engine