本文整理汇总了C#中Postal.Email.Send方法的典型用法代码示例。如果您正苦于以下问题:C# Email.Send方法的具体用法?C# Email.Send怎么用?C# Email.Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Postal.Email
的用法示例。
在下文中一共展示了Email.Send方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Send
public void Send(string content)
{
_smtpClient = new SmtpClient(Address, Port);
_smtpClient.Credentials = new NetworkCredential(Account, Password);
_smtpClient.EnableSsl = false;
MailMessage mailMessage = new MailMessage();
mailMessage.BodyEncoding = Encoding.UTF8;
mailMessage.From = new MailAddress(From, SenderName, Encoding.UTF8);
mailMessage.To.Add(To);
mailMessage.Body = content;
mailMessage.Subject = Subject;
_smtpClient.Send(mailMessage);
dynamic email = new Email("Example");
email.To = "[email protected]";
email.Send();
var viewsPath = Path.GetFullPath(@"..\..\Views");
var engines = new ViewEngineCollection();
engines.Add(new FileSystemRazorViewEngine(viewsPath));
var service = new EmailService(engines);
dynamic email = new Email("Test");
// Will look for Test.cshtml or Test.vbhtml in Views directory.
email.Message = "Hello, non-asp.net world!";
service.Send(email);
// RESTORE DATABASE is terminating abnormally.
}
示例2: Contact
public ActionResult Contact(ContactModel model)
{
// Build the contact email using a dynamic object for flexibility
dynamic email = new Email("Contact");
email.To = ConfigurationManager.AppSettings["email:ContactToAddress"];
email.From = ConfigurationManager.AppSettings["email:ContactFromAddress"];
email.FirstName = model.FirstName;
email.LastName = model.LastName;
email.BusinessType = model.BusinessType;
email.AddressLine1 = model.AddressLine1;
email.AddressLine2 = model.AddressLine2;
email.City = model.City;
email.State = model.State;
email.ZipCode = model.ZipCode;
email.Country = model.Country == "Other" ? model.CountryName : model.Country;
email.Phone = model.Phone;
email.Email = model.Email;
email.Comments = model.Comments;
email.Send();
// Set the ShowThanksMessage flag to provide user feedback on the page.
model.ShowThanksMessage = true;
return View(model);
}
示例3: NotifyTaskOwner
public static void NotifyTaskOwner(ContractTask task)
{
dynamic email = new Email("NotificationMail");
email.to = task.User.Email;
email.from = applicationEmail;
email.Send();
}
示例4: NotifyOnEscalation
public static void NotifyOnEscalation(ContractTask task, string contractOwnerEmail)
{
dynamic email = new Email("EscalationMail");
email.to = contractOwnerEmail;
email.from = applicationEmail;
email.Send();
}
示例5: SendHKNews
public static bool SendHKNews(HKNewsPaper paper)
{
dynamic email = new Email("~/MailTemplates/HKNews.cshtml");
email.Model = paper;
email.Send();
return true;
}
示例6: WelcomeSendPassword
public static void WelcomeSendPassword(string username, string toaddress, string pass)
{
dynamic email = new Email("~/MailTemplates/Teszt.cshtml");
email.To = toaddress;
email.UserName = username;
email.Password = pass;
email.Send();
}
示例7: SendSimple
public ActionResult SendSimple()
{
dynamic email = new Email("Simple");
email.Date = DateTime.UtcNow.ToString();
email.Send();
return RedirectToAction("Sent", "Home");
}
示例8: QueueEmail
public void QueueEmail(EmailViewModel emailViewModel)
{
dynamic email = new Email("SignUp");
email.To = emailViewModel.To;
email.ActivationToken = emailViewModel.ActivationToken;
email.BaseDomain = configuration.BaseDomain;
email.Send();
}
示例9: ForgotThePassword
public ActionResult ForgotThePassword(LoginViewModel loginModel)
{
dynamic email = new Email("ForgotThePassword");
email.To = "[email protected]";
email.FunnyLink = "Hello Alex :)";
email.Send();
return View();
}
示例10: Index
// GET: Home
public ActionResult Index()
{
dynamic email = new Email("Example");
email.To = "[email protected], [email protected], [email protected]";
email.FunnyLink = "http://blog.respag.net";
email.Fecha = DateTime.Now.ToString(@"dddd, dd \de MMMM \de yyyy");
email.Send();
return View();
}
示例11: ResetUserPassword
public JsonResult ResetUserPassword(string username, string emailAddress)
{
var confirmationToken = WebSecurity.GeneratePasswordResetToken(username);
dynamic email = new Email("ChngPasswordEmail");
email.To = emailAddress;
email.UserName = username;
email.ConfirmationToken = confirmationToken;
email.Send();
return Json(new { success = true });
}
示例12: Contact
public ActionResult Contact(string name, string useremail, string title, string message)
{
dynamic email = new Email("Contact");
email.From = useremail;
email.Name = name;
email.Title = title;
email.Message = message;
email.Send();
return View();
}
示例13: Send_creates_EmailService_and_calls_Send
public void Send_creates_EmailService_and_calls_Send()
{
var emailService = new Mock<IEmailService>();
Email.CreateEmailService = () => emailService.Object;
var email = new Email("Test");
email.Send();
emailService.Verify(s => s.Send(email));
}
示例14: SendAsync
public Task SendAsync(IdentityMessage message)
{
dynamic email = new Email("AuthEmail");
email.To = message.Destination;
email.Body = message.Body;
email.Subject = message.Subject;
email.Send();
return Task.FromResult(0);
}
示例15: RegistrationConfirmationEmail
public static void RegistrationConfirmationEmail(RegistrationConfirmationEmail input)
{
dynamic email = new Email("RegistrationConfirmation");
email.To = input.To;
email.From = input.From;
email.Subject = input.Subject;
email.Cc = input.Cc;
email.Bcc = input.Bcc;
email.ConfirmationLink = input.ConfirmationLink;
email.FullName = input.FullName;
email.Send();
}