Skip to content

no explain about email alarm url #720

@lordk911

Description

@lordk911
{
    "host": "mail.xx.com",          ## smtp host
    "port": "587",                  ## port
    "sa": "DGBOT",                  ## mail user
    "password": "abc@xxxxx",        ## mail user password
    "username": "[email protected]",     ## mail sender
    "enable_ssl": false             ## mail smtp enable ssl
}

private boolean send(String subject, String address, String content, MailServerInfo mailServer) {
MailSenderInfo mailInfo = new MailSenderInfo();
mailInfo.setMailServerHost(mailServer.getHost());
mailInfo.setMailServerPort(mailServer.getPort());
mailInfo.setValidate(true);
mailInfo.setUserName(mailServer.getSa());
mailInfo.setPassword(mailServer.getPassword());
mailInfo.setFromAddress(mailServer.getUsername());
mailInfo.setToAddress(address);
mailInfo.setSubject(subject);
mailInfo.setContent(content);
mailInfo.setEnableSsl(mailServer.isEnableSsl());
SimpleMailSender sms = new SimpleMailSender();
return sms.sendHtmlMail(mailInfo);// Send html format
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions