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);
        }
    }

本文标签: 腾讯发邮件企业邮箱