sfs2x send email

Email myEmail = new SFSEmail("so_lq@126.com", "360174425@qq.com", "Test mail", "Hello from SFS2X");
        try {
            SmartFoxServer.getInstance().getMailService().sendMail(myEmail);
        } catch (MessagingException e) {
            e.printStackTrace();
        }

xml 配置: config\server.xml

  <mailer>
    <isActive>true</isActive>
    <mailHost>smtp.126.com</mailHost>
    <mailUser>so_lq@126.com</mailUser>
    <mailPass>xxx</mailPass>
    <smtpPort>25</smtpPort>
    <workerThreads>1</workerThreads>
  </mailer>
原文地址:https://www.cnblogs.com/solq/p/2595178.html