正常に完了しましたvalidation of mail address
が、電子メール アドレスを確認するための提案が必要です。要点は、ユーザーがメール ID を入力するときに、それが本物か偽の ID かを確認する必要があるということです。なにか提案を?
6481 次
4 に答える
1
いいえ、ご利用いただけません。メールIDが有効かどうかを確認する権限がある独自のメールサーバーがある場合にのみ確認できます。または、他のサーバーを所有している場合、他のすべてのメールサーバーのミラーイメージを取得することが許可されている場合にのみ、確認できます。したがって、メールIDの単なるユーザーであれば、メールIDが有効かどうかを確認できます.
メール ID の正しい形式は、パターン チェックによってのみ確認できます。
楽しむ
于 2012-11-10T05:49:08.467 に答える
0
Properties props = System.getProperties();
props.put("mail.smtp.user", senderEmail);
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "465");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.debug", "true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.socketFactory.port", "465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
// Required to avoid security exception.
email.MyAuthenticator authentication =
new email.MyAuthenticator(senderEmail,senderMailPassword);
Session session =
Session.getDefaultInstance(props,authentication);
session.setDebug(true);
于 2012-11-30T09:33:15.197 に答える
0
public static void main(String[] args) throws Exception {
String email = null;
String dns = null;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter email address to validate: ");
email = reader.readLine();
System.out.print("Enter DNS hostname to perform domain validation (e.g. ns.myhost.com): ");
dns = reader.readLine();
// create EmailInspector instance
EmailInspector inspector = new EmailInspector();
// enable debugging
inspector.setDebug(true);
// set DNS server
inspector.setNameserver(dns);
// set validation level
inspector.setEmailInspectionLevel(inspector.DOMAIN_VALIDATION);
// validate email
inspector.validate(email);
}
}
. Create new EmailInspector instance.
. Enable debugging.
. Set DNS server to be used for looking up domains.
. Set validation level.
. Validate email address.
于 2012-11-30T07:31:42.703 に答える