public Text text;
public Button btn_rec;
public void OnButtonClick()
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("自己的邮箱");
mail.To.Add("自己的邮箱");
//邮件的标题
mail.Subject = "123456";
//邮件的内容
mail.Body = text.text;
SmtpClient smtpServer = new SmtpClient("smtp.163.com");
smtpServer.Port = 25;
smtpServer.Credentials = new System.Net.NetworkCredential("自己的邮箱", "AVIGHTZYNSINDXZX") as ICredentialsByHost;
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtpServer.Send(mail);
Debug.Log("success");
}
``
unity 发送信息到邮箱
最新推荐文章于 2023-05-19 20:10:43 发布