addReplyTo doesn't seem to work
everyone.
I'm trying to configure a email specifying an email address to reply to u开发者_运维知识库sing the addReplyTo method and although the email is sent successfully
when I log into the email account(octunprg@gmail.com) to read and reply to the email that has just been sent, the email address that appears in the To field is the same email address (octunprg@gmail.com) not the one I indicated using "addReplyTo"(eddysmith1818@gmail.com) when I set the email.
Is it the normal operation?? Am I doing something wrong??
Email email = new SimpleEmail();
email.setHostName("smtp.gmail.com");
email.setSmtpPort(587);
email.setAuthenticator(new DefaultAuthenticator("octunprg@gmail.com", "123456"));
email.setTLS(true);
email.setFrom(from, name);// 'eddysmith1818@gmail.com', 'Eddy Smith'
email.setSubject(subject);
email.setMsg(message);
email.addReplyTo(from, name); // 'eddysmith1818@gmail.com', 'Eddy Smith'
email.addTo("octunprg@gmail.com");
email.send();
This may be a mistake in your email client (Gmail, as I see).
精彩评论