private void SendRegisteredUser(string email_address) { var subject = $"A user registered for ORUK"; var body = $"{email_address} registered for ORUK.<br />See the full list at <a href=\"{Settings.RegisteredUsersUrl}\">{Settings.RegisteredUsersUrl}</a>."; try { EmailUtility.Send(Smtp, Settings.DefaultSupportEmail, Settings.RegisterAlertEmail, subject, body); } catch (Exception e) { Console.Error.Write(e.Message); } }
private void SendRegisteredOrganisationEmail(RegisterOrganisationParameters parameters) { var subject = $"{parameters.organisation_name} registered for ORUK"; var body = $"{parameters.organisation_name} ({parameters.private_email_address}) registered for ORUK.<br />See the full list at <a href=\"{Settings.RegisteredOrganisationsUrl}\">{Settings.RegisteredOrganisationsUrl}</a>."; try { EmailUtility.Send(Smtp, Settings.DefaultSupportEmail, Settings.RegisterAlertEmail, subject, body); } catch (Exception e) { Console.Error.Write(e.Message); } }
public ActionResult index() { MailInfo info = new MailInfo(); EmailUtility sendemail = new EmailUtility(); sendemail.Send(new MailInfo { ToEmailAddress = { "*****@*****.**" }, ToCcEmailAddress = { "*****@*****.**" }, //FromEmailAddress = string.Empty, //FromEmailPassword = string.Empty, EmailSubject = "用163测试发送邮件", EmailBody = "邮件主体", EmailPersonName = "发件人姓名wang", //EmailHostName = string.Empty, EmailPriority = EmailPriorityEnum.High, EmailPort = 25, IsBodyHtml = true, EncodingType = Encoding.UTF8, }); return(Content("已经发送")); }