Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System;
- using System.Net;
- using System.Net.Mail;
- using System.Net.Security;
- using System.Security.Cryptography.X509Certificates;
- public class SendMail : MonoBehaviour {
- public void RegistrationMail ()
- {
- MailMessage mail = new MailMessage();
- mail.From = new MailAddress("Advoxelteam@gmail.com");
- mail.To.Add(RegisterEmail.chooseEmail);
- mail.Subject = "Thanks for your registration";
- mail.Body = "Hello, welcome to Advoxel! " +
- "Your account has been successfully registered. " +
- "We hope you have a nice time in Advoxel! " +
- "Username : " + RegisterUsername.chooseUsername +
- " " + " " +
- "Password : " + RegisterPassword.choosePassword +
- "." +
- " Use this confirmation code: " + ConfirmCode.RandomCode;
- SmtpClient smtpServer = new SmtpClient("smtp.gmail.com");
- smtpServer.Port = 587;
- smtpServer.Credentials = new System.Net.NetworkCredential("Advoxelteam@gmail.com", "advoxelmmo2001") as ICredentialsByHost;
- smtpServer.EnableSsl = true;
- ServicePointManager.ServerCertificateValidationCallback =
- delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
- { return true; };
- smtpServer.Send(mail);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement