发送邮件怎么搞得?sms_flag每次都是false。手动改为true 都执行了也不发送邮件。
/**
 * 默认帐号发送邮件
 * 
 * @param title
 *            //标题
 * @param receiveMail
 *            //接收方email
 * @param templateCode
 *            //模板编号
 * @param map
 *            //邮件模板替换参数
 * @return
 */
public boolean sendMail(String title, String receiveMail,
        String templateCode, Map<String, Object> map, Integer priority) {
    return sendMail(null, null, title, receiveMail, null, null, null,
            templateCode, map, priority);
}

---------------------------------------------------------

String sms_flag = (String) MemcachedUtils.getInstance().getClient()
            .get("baseConfig.sms.flag");
    if ("true".equals(sms_flag)) {
        if (code.equals("0")) {
            map.put("address", AddressTool.getAddress("www")+ "/doValidEmail.htm?key=" + key + "&account" + account+ "&vcode=" + vcode);
            MailUtil.getInstance().sendMail("邮件密码找回", email,
                    "feiliao91-pwd-mail", map, 0);
        } else if (code.equals("1")) {
            map.put("address", AddressTool.getAddress("trade")
                    + "/security/unValidEmail.htm?key=" + key + "&account="
                    + account + "&vcode=" + vcode + "&email=" + email);
            MailUtil.getInstance().sendMail("邮件解绑", email,
                    "feiliao91-email-mailUnbind", map, 0);
        } else if (code.equals("2")) {
            map.put("address", AddressTool.getAddress("trade")
                    + "/security/doValidEmail.htm?key=" + key + "&account="
                    + account + "&vcode=" + vcode + "&email=" + email);
            MailUtil.getInstance().sendMail("邮件绑定", email,
                    "feiliao91-email-mailBind", map, 0);
        }
    } else {
        // 本地打印信息
        System.out.println(map);
    }

    ---------------------------------------------------------------

    public ModelAndView doSendEmail(Map<String, Object> out,
        HttpServletRequest request, String email, String account) {
    if(email==null){
        return new ModelAndView("redirect:doForgetPwd.htm?account="+account);
    }
    companyValidateService.sendCodeByEmail(email, account, "0");
    return new ModelAndView("redirect:/forgetPwdEmail.htm?account="
            + account + "&email=" + email);
}

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐