ASP.Net 邮箱发送
2021-01-30 09:14
YPE html>
标签:public end ble lan vma send 控制 com host
邮件发送的页面
标题: | |
---|---|
收件人: | |
正文: | |
邮件发送的控制器
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using G6.WeekTwo.Models;
namespace G6.WeekTwo.Controllers
{
public class MailController : ApiController
{
[HttpPost]
public int SendMailMethod(EmailModel model)
{
//List
// "691805617@qq.com",
// "31900477@qq.com"
//};
try
{
string[] arr = null;
if(model.RecMails.Contains(","))
{
arr = model.RecMails.Split(‘,‘);
}else
{
arr = new string[] { model.RecMails };
}
SendMail mail = new SendMail(arr, "31900477@qq.com", model.BodyContent, model.Title, "sfeamvgjafykbgdh");
mail.Send();
return 1;
}
catch (Exception ex)
{
return 0;
}
}
}
}
邮件发送的类
请在这个链接查询
https://www.cnblogs.com/freedomlan/p/13184891.html
ASP.Net 邮箱发送
标签:public end ble lan vma send 控制 com host
原文地址:https://www.cnblogs.com/XJNB/p/13196348.html
上一篇:数据采集flume kafka
下一篇:TCP和HTTP