Hi All,
I am trying to send an email with a small attachment (12 kb).
When doing so, the game pauses briefly while sending the message.
Is there any way to avoid this pause?
Thanks,
Roger
public static function SendEmail(){
//if (System.IO.File.Exists(logfile)){
try{
var emailtouse = "myemailaddress@gmail.com";
var sender: Object;
var certificate: System.Security.Cryptography.X509Certificates.X509Certificate;
var chain: System.Security.Cryptography.X509Certificates.X509Chain;
var sslPolicyErrors: System.Net.Security.SslPolicyErrors;
var mail: MailMessage = new MailMessage();
mail.From = new MailAddress(emailtouse);
mail.To.Add(emailtouse);
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL using JAVA";
var attachmentPath = Application.persistentDataPath + "/logtext.txt";
//Debug.Log("filenamesent"+filename);
var attachment: System.Net.Mail.Attachment = new System.Net.Mail.Attachment(attachmentPath);
mail.Attachments.Add(attachment);
var smtpServer: SmtpClient = new SmtpClient("smtp.gmail.com");
smtpServer.Port = 587;
smtpServer.Credentials = new System.Net.NetworkCredential(emailtouse, "mysecretpassword") as ICredentialsByHost;
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback = function(sender, certificate, chain, sslPolicyErrors) { return true; };
smtpServer.Send(mail);
Debug.Log("success");
}
catch (err) {
print (err.Message);
}
//}
}