// GET: Mass
        public ActionResult Index()
        {
            var mailTask = new MailTask();

            mailTask.Subject = "Test email from ASP.NET MVC";
            mailTask.IsAuthenticationRequired = false;

            var body = new StringBuilder();

            body.Append("This sample demonstrates how to send multiple emails from ASP.NET MVC with thread pool.\r\n\r\n");
            body.Append("From: [$sender]\r\n");
            body.Append("To: [$rcpt]\r\n");
            body.Append("Subject: [$subject]\r\n\r\n");

            body.Append("Above sender, rcpt, subject values will be replaced by actual value based on each recipient.\r\n\r\n");
            body.Append("If no sever address was specified, the email will be delivered to the recipient's server directly.\r\n");
            body.Append("However, it is not recommended, because most email providers would reject your message due to anti-spam policy.\r\n");

            mailTask.TextBody = body.ToString();

            ViewBag.Port     = DropDownListData.PortList(mailTask.Port);
            ViewBag.Protocol = DropDownListData.ProtocolList(mailTask.Protocol);

            ViewBag.IsSyncSendSucceeded = false;
            ViewBag.SyncSendStatus      = string.Empty;

            return(View(mailTask));
        }
        public ActionResult Index(MailTask mailTask)
        {
            ViewBag.Port     = DropDownListData.PortList(mailTask.Port);
            ViewBag.Protocol = DropDownListData.ProtocolList(mailTask.Protocol);

            if (ModelState.IsValid)
            {
                _syncSendMail(mailTask);
            }

            return(View(mailTask));
        }
Beispiel #3
0
 ActionResult _mailView(MailTask mailTask)
 {
     ViewBag.Port          = DropDownListData.PortList(mailTask.Port);
     ViewBag.OauthProvider = DropDownListData.OauthList(mailTask.OauthProvider);
     return(View("Index", mailTask));
 }
Beispiel #4
0
 ActionResult _mailView(MailTask mailTask)
 {
     ViewBag.Port = DropDownListData.PortList(mailTask.Port);
     return(View("Index", mailTask));
 }