1 import java.net.*;
2 import java.io.*;
3 :
4 Socket socketSmtpServer = null;
5 DataOutputStream dos = null;
6 DataInputStream dis = null; 7 try {
8 socketSmtpServer = new Socket("email.seu.edu.cn",10);
9 dos = new DataOutputStream(socketSmtpServer.getOutputStream());
10 dis = new DataInputStream (socketSmtpServer.getInputStream());
11 }
12 catch (UnknownHostException e) {throw (e);}
13 catch (IOException e) {throw (e);}

解决方案 »

  1.   

    看看这个代码:
    Properties props = new Properties();
    props.put("mail.smtp.host", "你要指定的邮件服务器地址");
    props.put("mail.smtp.port", 10);//注意端口的参数是整形祝你好运!
      

  2.   

    可是没有
    props.put(Stting,int)函数阿
      

  3.   

    抱歉,修改如下:Properties props = new Properties();
    props.put("mail.smtp.host", "你要指定的邮件服务器地址");
    props.put("mail.smtp.port", new Integer(10));//注意端口的参数是整形你试试看,我也只是察看javamail的文档。祝你好运!