Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4. using System.Net;
  5. using System.Net.Mail;
  6. using System.Net.Security;
  7. using System.Security.Cryptography.X509Certificates;
  8.  
  9. public class SendMail : MonoBehaviour {
  10.  
  11. public void RegistrationMail ()
  12. {
  13. MailMessage mail = new MailMessage();
  14.  
  15. mail.From = new MailAddress("Advoxelteam@gmail.com");
  16. mail.To.Add(RegisterEmail.chooseEmail);
  17. mail.Subject = "Thanks for your registration";
  18. mail.Body = "Hello, welcome to Advoxel! " +
  19. "Your account has been successfully registered. " +
  20. "We hope you have a nice time in Advoxel! " +
  21. "Username : " + RegisterUsername.chooseUsername +
  22. " " + " " +
  23. "Password : " + RegisterPassword.choosePassword +
  24. "." +
  25. " Use this confirmation code: " + ConfirmCode.RandomCode;
  26.  
  27.  
  28.  
  29. SmtpClient smtpServer = new SmtpClient("smtp.gmail.com");
  30. smtpServer.Port = 587;
  31. smtpServer.Credentials = new System.Net.NetworkCredential("Advoxelteam@gmail.com", "advoxelmmo2001") as ICredentialsByHost;
  32. smtpServer.EnableSsl = true;
  33. ServicePointManager.ServerCertificateValidationCallback =
  34. delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
  35. { return true; };
  36. smtpServer.Send(mail);
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement