Hi.
I am trying to send an e-mail with the JavaMail API, but I am not being successful. Here is the code:
try{
SmtpClient client = new SmtpClient("???.???.?.?");
//client.from("mymailfrom@test.com");
client.to("mymailto@test.com");
PrintStream message = client.startMessage();
message.println("From: " + from);
message.println("To: " + to);
message.println("This was sent from a
JSP page!");
message.println();
client.();
client.closeServer();
}
catch (IOException e){
System.out.println("ERROR SENDING EMAIL:"+e);
}
And here is the error:
C:\Tomcat 4.1\work\Standalone\localhost\examples\jsp\Cms\cmsEmail_jsp.java:56: cannot resolve symbol
symbol : method sendMail ()
location: class sun.net.smtp.SmtpClient
client.sendMail();
^
1 error
I don't know the correct host and port to use.
Could anyone help me? Where is the problem?
Thanks.