我做了一个邮箱登录界面,就想用户输入用户名,密码,邮箱smtp服务器后,点击“登录”按钮,若存在这个用户,则就可以跳到我编写的另一个邮箱登录成功后的界面,若没有这个用户,则要重新输入,邮箱服务器是依赖sohu或是163的服务器的,拜托大家教教 我啊,非常感谢

解决方案 »

  1.   

    判断后台数据库,
    select * from table where username and password
      

  2.   

    拜托大家教教我 ,比如下面这段代码:
    try{
    Properties props=new Properties();
    props.setProperty("mail.transport.protocol", "smtp"); 
    props.setProperty("mail.smtp.host",SMTPServer);
    props.setProperty("mail.smtp.auth","true");
    Session session=Session.getDefaultInstance(props,new Authenticator()
    {
    public PasswordAuthentication getPasswordAuthentication(){
    return new PasswordAuthentication(textCfigAccount.getText(),Configuration.getPassword());
    }
    });
    }session从服务器返回什么值就知道成功登录了??