Question by
villyviking · Jun 13, 2017 at 07:12 PM ·
unity 5timercountdownemail
Need thinking event, during time it takes to smtpserver.send
How can I run an event during emails sending time?
private void SendEmail ()
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("my@gmail.com");
mail.To.Add(clientIf.text);
mail.Subject = "Ai coaching report.";
mail.Body = clientSummary;
SmtpClient smtpServer = new SmtpClient("asmtp.unoeuro.com");
smtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpServer.Port = 587;
//smtpServer.Credentials = new System.Net.NetworkCredential("my@gmail.com", "myPassword") as ICredentialsByHost;
smtpServer.Credentials = new System.Net.NetworkCredential("my@domain.com", "myPassword") as ICredentialsByHost;
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) {
return true;
};
smtpServer.Send(mail);
//while smtpServer is sending email, show rotating icon??
}
Any comments much appreciated.
Comment