admin管理员组文章数量:1559056
//发件人账号
private string emailusename;
//发件人密码
private string emailpassword;
//smtp.exmail.qq
private string emailsmtpserver;
//收件人账号
private string[] emailtoaddress;
public void sendmail(string subject, string content, string... toaddress) {
htmlemail email = new htmlemail();
email.sethostname(emailsmtpserver);
email.setauthenticator(new defaultauthenticator(emailusename, emailpassword));
email.setsslonconnect(true);
try {
email.setfrom(emailusename);
email.setsubject(subject);
email.setmsg(content);
email.addto(toaddress);
email.setcharset("utf-8");
email.send();
} catch (exception e) {
log.error("发送邮件通知失败", e);
}
}
j9九游会老哥俱乐部交流区的版权声明:本文标题:java实现腾讯企业邮箱发邮件 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1727422214a1113707.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论