【发布时间】:2016-10-30 20:35:04
【问题描述】:
我通过 SMTP 发送电子邮件(使用邮件提供商 web.de),使用以下代码:
package form.controll;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class NotificationControllerTest {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void test() {
NotificationController aNotifi = new NotificationController( "smtp.web.de", "587" );
aNotifi.sendEmail( "TARGETEMAIL@blabla.de", "SENDERSEMAIL@web.de", "THESENDERSPASSWORD", "New User Registration Notification", "New User has just been registered to blabla" );
}
}
这很好用,但如果我在代理上下文中使用相同的方法, 我总是得到错误:
535 身份验证凭据无效
-为什么会这样? -如何修复电子邮件发送?
【问题讨论】: