这是我向用户发送邮件的代码。
mailMessage=new SimpleMailMessage();
Strinf passwoed="Abij@1"
String emailHeader = "Dear,";
String emailFooter= "Thanks & Regards ";
mailMessage.setFrom("admin@hcl.com");
mailMessage.setTo("user@hcl.com");
mailMessage.setSubject("Email For Password");
mailMessage.setText(emailHeader + " \n EMAIL: " + this.newUserModel.getEmailId()+ "\n PASSWORD : " + passWord+ "\n " + emailFooter );
try {
mailSender.send(mailMessage);
}
catch (Exception e) {
logger.info("exception is :"+e.getMessage());
}
当我运行此代码时,我得到一个异常是:null message..