Oi galera.
Usando o SMTP do IG estou tentando passar um email usando JSP com este código:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,java.io.*, sun.net.smtp.SmtpClient;" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<% String from="[email removido]";
String to="[email removido]"; %>
<p>Sending mail from <%=from%> to <%=to%></p><%
try{SmtpClient client = new SmtpClient("smtp.ig.com.br");
client.from(from);
client.to(to);
PrintStream msg = client.startMessage();
msg.println("to:"+to);
msg.println("Subject:Sending e-mail from Zamples");
msg.print("\r\n");
msg.println("This email was sent from a JSP built by Zamples.");
msg.println("See [url]http://zamples.com[/url] for more information.");
client.closeServer();
} catch(IOException e) {
out.println("error" + e);
} %>
</body>
</html>
Ao executar o JSP aparece o seguinte erro:
Sending mail from [email removido] to [email removido]
errorsun.net.smtp.SmtpProtocolException: 530 authentication needed
Alguém sabe como colocar autenticação neste código?