using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SendSmtpMail : MonoBehaviour
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("hookahmailapp@gmail.com");
mail.To.Add("hookahmailapp@gmail.com");
mail.Subject = "Test Smtp Mail";
mail.Body = "Testing SMTP mail from GMAIL";
// you can use others too.
SmtpClient smtpServer = new SmtpClient("
smtp.gmail.com");
smtpServer.Port = 587;
smtpServer.Credentials = new System.Net.NetworkCredential("hookahmailapp@gmail.com", "psswd") as ICredentialsByHost;
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtpServer.Send(mail);
}
то есть вот так плохо?