Hello, i have getting this script on google
using UnityEngine;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class SendMail : MonoBehaviour
{
void Start()
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("darklou31@gmail.com");
mail.To.Add("Inconnue@gmail.com");
mail.Subject = "Info";
mail.Body = "Test mail";
SmtpClient smtpServer = new SmtpClient("smtp.gmail.com");
smtpServer.Port = 587;
smtpServer.Credentials = new System.Net.NetworkCredential("youraddress@gmail.com", "yourpassword") as ICredentialsByHost;
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtpServer.Send(mail);
Debug.Log("success");
}
}
but i don’t understand the line next:
smtpServer.Credentials = new System.Net.NetworkCredential("youraddress@gmail.com", "yourpassword") as ICredentialsByHost;
what is “youraddress@gmail.com” and “yourpassword”
how getting that
Thanks