@page @using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Mvc @using ZoomLa.Model.SYS @using ZoomLa.BLL.Helper @model PageModel @functions{ public class PageModel : Page_Base { public M_EMail_Item email = new M_EMail_Item(); public IActionResult OnGet() { email.ToAddress = GetParam("email"); email.Subject = HttpUtility.UrlDecode(GetParam("t")); email.MailBody = HttpUtility.UrlDecode(GetParam("c")); return Page(); } public IActionResult OnPost() { return Content(Success.ToString()); } public IActionResult OnPostSave() { M_EMail_Item mailMod = new M_EMail_Item(); mailMod.Subject = GetParam("Subject"); mailMod.FromName = GetParam("formName"); mailMod.MailBody = GetParam("MailBody"); mailMod.ToAddress = GetParam("ToAddress"); ZoomLa.BLL.SYS.B_EMailHelper.SendAsync(mailMod);//自动将mailMod写入数据库 return Redirect("MailSend?r=1"); } } } @{ Layout = "_empty"; } @section head{ 快邮_@Call.SiteName } @section content{ @if (HttpContext.Request.GetParam("r").Equals("1")) {
操作完成

邮件已成功发送

} else {

向我们提交邮件

收件人
发件人
发件人姓名,该值不可为Email,否则可能会被目标邮箱过滤
邮件标题
邮件内容->
✘ 关闭窗口
示例URL:/Page/MailSend?email=收件人邮箱&t=邮件标题&c=邮件内容
} } @section script{ @MvcHtmlString.Create(Call.GetUEditor("MailBody", 2)) }