-
-
Save unitycoder/80cbcffcb722c13c29d2f696db63348d to your computer and use it in GitHub Desktop.
Revisions
-
marcotmp revised this gist
Apr 1, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,6 @@ using System.Net.Mail; using System.Net.Security; using System.Security.Cryptography.X509Certificates; public class UnityGMail { -
marcotmp revised this gist
Apr 1, 2022 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ using System.ComponentModel; using System.Net; using System.Net.Mail; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using UnityEngine; public class UnityGMail { public void SendMailFromGoogle() -
marcotmp revised this gist
Apr 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ public class UnityGMail { public void SendMailFromGoogle() { -
marcotmp revised this gist
Apr 1, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public void SendMailFromGoogle() smtp.Port = 587; // Account Username: Usually your "from" email. // App Password: If your account has a 2 step verification, you must follow these instructions // to generate the password: https://support.google.com/accounts/answer/185833?hl=en. smtp.Credentials = new NetworkCredential("Account Username", "App Password") as ICredentialsByHost; smtp.EnableSsl = true; -
marcotmp renamed this gist
Apr 1, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
marcotmp created this gist
Apr 1, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ public class GMail { public void SendMailFromGoogle() { MailMessage mail = new MailMessage(); mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.Subject = "Email Subject"; mail.Body = "Email Body"; var attachment = new Attachment("C:\\path\\file.ext"); mail.Attachments.Add(attachment); SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.Port = 587; // Account Username: Usually your "from" email. // App Password: If your app has a 2 step verification, you must follow these instructions // to generate the password: https://support.google.com/accounts/answer/185833?hl=en. smtp.Credentials = new NetworkCredential("Account Username", "App Password") as ICredentialsByHost; smtp.EnableSsl = true; ServicePointManager.ServerCertificateValidationCallback = delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; smtp.Send(mail); } }