Esempio n. 1
0
 private void SendConfirmationMail(MembershipUser user, string newEmail)
 {
     HtmlTemplate<ChangeEmailConfirmation> body = new HtmlTemplate<ChangeEmailConfirmation>();
     body.Template.Email = newEmail;
     body.Template.Code = user.ProviderUserKey.ToString();
     body.Template.Checker = Hash.ReadableHash(Hash.MD5, newEmail + body.Template.Code);
     body.Template.Host = Request.Url.Host;
     MailMessage m = new MailMessage("*****@*****.**", newEmail, CommonResources.ChangeEmailEmailSubject, body.GenerateHtml());
     m.IsBodyHtml = true;
     new System.Net.Mail.SmtpClient().Send(m);
 }
Esempio n. 2
0
 public static void SendRegistrationMail(MembershipUser user, string password)
 {
     HtmlTemplate<CompleteRegistration> body = new HtmlTemplate<CompleteRegistration>();
       body.Template.Login = user.UserName;
       body.Template.Password = password;
       body.Template.Code = user.ProviderUserKey.ToString();
       body.Template.Host = HttpContext.Current.Request.Url.Host;
       var to = new MailAddress(user.Email, user.UserName);
       var m = SmtpManager.Instance.CreateMail(to
     , CommonResources.RegistrationEmailSubject
     , body.GenerateHtml());
       SmtpManager.Instance.Send(m);
 }
Esempio n. 3
0
 private void SendConfirmationMail(MembershipUser user, string newEmail)
 {
     HtmlTemplate<ChangeEmailConfirmation> body = new HtmlTemplate<ChangeEmailConfirmation>();
     body.Template.Email = newEmail;
     body.Template.Code = user.ProviderUserKey.ToString();
     body.Template.Checker = Hash.ReadableHash(Hash.MD5, newEmail + body.Template.Code);
     body.Template.Host = Request.Url.Host;
     var to = new MailAddress(newEmail, user.UserName);
     var m = SmtpManager.Instance.CreateMail(to
       , CommonResources.ChangeEmailEmailSubject
       , body.GenerateHtml());
     SmtpManager.Instance.Send(m);
 }
Esempio n. 4
0
 public void Send(Message m)
 {
     var user = Membership.GetUser(m.RecipientId);
       if (user != null && user.IsOnline == false)
       {
     var profile = CustomProfileProvider.GetProfileByUserKey(m.RecipientId);
     if (profile != null && profile.EmailMessageNotification == true)
     {
       HtmlTemplate<NewMessageNotification> body = new HtmlTemplate<NewMessageNotification>();
       body.Template.SenderId = m.SenderId;
       body.Template.RecipientId = m.RecipientId;
       var to = new MailAddress(user.Email, user.UserName);
       var mail = SmtpManager.Instance.CreateMail(to
     , CommonResources.Notification_NewMessageSubject
     , body.GenerateHtml());
       SmtpManager.Instance.Send(mail);
     }
       }
 }
Esempio n. 5
0
 private void SendRegistrationMail(MembershipUser user)
 {
     HtmlTemplate<CompleteRegistration> body = new HtmlTemplate<CompleteRegistration>();
       body.Template.Login = cuwRegisterUser.UserName;
       body.Template.Password = cuwRegisterUser.Password;
       body.Template.Code = user.ProviderUserKey.ToString();
       body.Template.Host = Request.Url.Host;
       MailMessage m = new MailMessage(SmtpManager.Instance.Config.RegistrationEmail, user.Email, CommonResources.RegistrationEmailSubject, body.GenerateHtml());
       m.IsBodyHtml = true;
       SmtpManager.Instance.Send(m);
 }