把Session session = Session.getDefaultInstance(props, null);
改成Session session = Session.getDefaultInstance(props);
试试吧!

解决方案 »

  1.   

    protected Properties mailProperties = System.getProperties();
        protected boolean mailSave = false;
        protected Store mailStore = null;
        protected Folder mailFolder = null;
        protected Session mailSession = null;
        protected String mailHost = null;
        protected int mailPort = 110;
        protected String userName = null;
        protected String userPass = null;    public MailReceiver(String mail_host, int mail_port, String username, String password, boolean is_save)
        {
            this.mailHost = mail_host;
            this.mailProperties.put("mail.smtp.host", mail_host);
            this.userName = username;
            this.userPass = password;
            this.mailSave = is_save;
            this.mailPort = mail_port;
            this.mailSession = Session.getDefaultInstance(mailProperties, null);
        }