so, i looked around for a proper c# emailing script, it just needs to send text. And i could not find anything that sent the email, i am now stuck with this code:
using System;
using UnityEngine;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class mono_gmail : MonoBehaviour
{
public static void Main (string[] args)
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("email@gmail.com");
mail.To.Add("email@gmail.com");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpClient smtpServer = new SmtpClient("smtp.gmail.com");
smtpServer.Port = 465;
smtpServer.Credentials = new System.Net.NetworkCredential("email@gmail.com", "password");
smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtpServer.Send(mail);
}
}
also, the email and password fields are filled in, but just not here for security purposes.
And i did the 465 port since that is the outgoing mail server port for ssl.
PS : nothing is printing errors either.
I hope you can help, thanks!