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);
}
}
using UnityEngine;
using System.Collections;
using System;
using System.Net;
using System.Net.Mail;
Find more questions by tags Unity Game Engine
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