如何验证电子邮件(Yahoo、Gmail、Hotmail 和 AOL)的用户名和密码?应该把 cide 到 auth 电子邮件放在哪里?
这是我的代码
public class AuthMail
{
public static void authEmail()
{
if(LoginDialog.t_Email.getText().isEmpty())
{
Util.printErrorMessage("Plase Enter an Email Address");
JOptionPane.showMessageDialog(null, "Plase Enter an Email Address", "Error", JOptionPane.ERROR_MESSAGE);
}
else if(LoginDialog.p_Password.getText().isEmpty())
{
System.out.println("Plase Enter Your Password");
JOptionPane.showMessageDialog(null, "Plase Enter Your Password", "Error", JOptionPane.ERROR_MESSAGE);
}
else if(Util.getMailType().equals("GMail"))
{
System.out.println("Logging...");
System.out.println("Attempting connection to GMail...");
}
else if(Util.getMailType().equals("Yahoo"))
{
System.out.println("Logging...");
System.out.println("Attempting connection to Yahoo...");
}
else if(Util.getMailType().equals("Yahoo"))
{
System.out.println("Logging...");
System.out.println("Attempting connection to Hotmail...");
}
else if(Util.getMailType().equals("AOL"))
{
System.out.println("Logging...");
System.out.println("Attempting connection to Aol...");
}
else if(Util.getMailType().equals("Unknown"))
{
System.out.println("Mail Type Unknown");
int var1 = JOptionPane.showConfirmDialog(null, "Email Type Unknown. Did you want to try again?", "Error", JOptionPane.YES_NO_OPTION);
if(var1 == JOptionPane.NO_OPTION)
{
System.exit(0);
}
}
}
}
注意:Util.class 是我自己创建的。