在进行转发时,提示无法实现转发,是什么原因呢,下面是部分代码:- Address from = new InternetAddress(myEmail);
- Address to = new InternetAddress(Email);
- MimeMessage msg = new MimeMessage(session);
- msg.setFrom(from);
- msg.setSubject("xxxxxxx报名系统");
- msg.setSentDate(new Date());
- msg.setContent("您已报名成功\n请点击<A href='" + url + "'>" + url
- + "</A>完成注册", "text/html;charset=utf-8");
- msg.setRecipient(RecipientType.TO, to);
- /*
- * Transport transport = session.getTransport("smtp");
- * transport.connect("smtp.163.com", userName, password);
- * transport.sendMessage(msg,msg.getAllRecipients());
- * transport.close();
- */
- Transport.send(msg);
- } catch (Exception e) {
- e.printStackTrace();
- }
- request.getRequestDispatcher("/sendMailSuccess.jsp").forward(request,
- response);
复制代码 |