我正在尝试在Websphere 7中创建一个javamail会话来使用GMail,但我的身份验证总是失败.
是的,我的密码还可以......
我正在将Session配置为:
输出邮件属性
在会话属性中,我有:
我正在使用类似于...的测试JSP
...
System.out.println("Entering MailJsp!");
String errorMessage = null;
String destinationAddress = request.getParameter("destinationAddress");
String messageBody = request.getParameter("message");
String subject = "Mail from MailServlet";
String emailFrom = "myuser@gmail.com";
// try only if it is not the first request
if (destinationAddress != null) {
System.out.println("Sending email");
try
{
// look up MailSession
Context …Run Code Online (Sandbox Code Playgroud)