How can I send an attachment using sun.net.smtp.SmtpClient?

John Zukowski

From the looks of the public API:


public class sun.net.smtp.SmtpClient 
    extends sun.net.TransferProtocolClient {
  public void closeServer() 
    throws IOException;
  public void to(String) 
    throws IOException;
  public void from(String) 
    throws IOException;
  public PrintStream startMessage() 
    throws IOException;
  public sun.net.smtp.SmtpClient(String) 
    throws IOException;
  public sun.net.smtp.SmtpClient() 
    throws IOException;
  public String getMailHost();
}
It appears to only support sending simple messages, not attachments. You'll need to use the JavaMail capabilities instead.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact