发送邮件-自定义发件账户原创
1人赞赏了该文章
169次浏览
编辑于2023年09月26日 08:51:27
接口文档 https://vip.kingdee.com/article/131834587734451200
try {
File file = new File(filepath);
StreamReader streamReader = new StreamReader(file.Filepath);
Dictionary<string, Stream> dic = new Dictionary<string, Stream>
{ { "路径", streamReader.BaseStream//字符流附件 } };
//收件人列表
List<string> getuser = new List<string>(new[] { "收件人邮箱地址" });
MailUtils.Sendmail("邮箱地址", "发件人昵称", 收件人列表 , "标题", "正文", "邮箱服务器", 端口, 是否启用SSL(true or false), dic, "邮箱地址", "邮箱密码");
}catch{
View.ShowErrMessage("邮件发送失败");
}
推荐阅读