Hi,
I am currently working on a project for university which requires me to send and receive email. I was until this week able to send mail no problem, but now the SMTP server has been upgraded so that each time a mail is sent it requires the username and password.
Ideally the connection should be made using TLS/SSL, and not use the Authenticator method. I want to pass the username and password directly if possible.
I've been trying to use the following but have been getting handshake, and other exceptions:
SMTPSSLTransport smtpSSLtransport = new SMTPSSLTransport(session,
new URLName("smtp", smtpHost, port, null-File,
"USERNAME", "PASSWORD"));
smtpSSLtransport.setStartTLS(true);
smtpSSLtransport.connect(new Socket(smtpHost, port));
smtpSSLtransport.sendMessage(smtpMessage, message.getAllRecipients());
smtpSSLtransport.close();
Can anyone correct this piece of code for me or point me in the right direction of what classes and methods I should be using?
Many thanks in advance,
Gordon