- Home /
My mail system works well on the editor but when i run it on an android device mail system is not working...please help me solve this issue
I have followed necessary settings like 1.setting API compatibility to Net.2.0 standard 2.changed internet access to require 3. managed stripping level to disabled but still my mail doesnt work on android build when i run the app on the editor it is working simply smooth
using UnityEngine; using System; using System.Collections; using System.Collections.Generic; using UnityEngine.UI; using System.Net; using System.Net.Mail; using System.Net.Security; using System.Security.Cryptography.X509Certificates;
public class PrizmabrixxEmailFactory : MonoBehaviour {
public void SendEmail()
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
SmtpServer.Timeout = 10000;
SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
SmtpServer.UseDefaultCredentials = false;
SmtpServer.Port = 587;
mail.From = new MailAddress("frommail@gmail.com");
mail.To.Add(new MailAddress("tomail@gmail.com"));
mail.Subject = "Client In ";
mail.Body = "Body;
SmtpServer.Credentials = new System.Net.NetworkCredential("frommail@gmail.com", "password") as ICredentialsByHost; SmtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback = delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return true;
};
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
SmtpServer.Send(mail);
}
}
Your answer

Follow this Question
Related Questions
Can we create android app builds on MAC book air 1 Answer
Computer Crashed and Keystore lost 0 Answers
android Build Issue 1 Answer
My script is causing lag 3 Answers
Super Weird bug for an Android Build 0 Answers