This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Before Sending Emails

 
Ranch Hand
Posts: 851
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) I am editing my message to make more to the point that I don't need any regex to check the syntax that it has @ and dot or not like these things.

2) I need to know that how can decided about the email that it'll not be bounced?

Thanks & regards
[ November 04, 2008: Message edited by: Farakh khan ]
 
Sheriff
Posts: 22567
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) You can use the InternetAddress class and its constructors to verify email addresses.

2) You can't determine whether or not a message will be bounced until the message is actually sent. There are multiple reasons a message can be bounced:
  • The email server does not exist. InetAddress.isReachable can help you with finding out.
  • The SMTP port is closed. Socket can help you with finding out. Of course a Socket can also help you find out if the email server exists; if it doesn't the socket will fail as well.
  • The mailbox is invalid for the mail server. You can't find out before sending.
  • The mailbox is full. You can't find out before sending.

  • This list is not exhaustive; there are probably dozens of more reasons a mail server can reject (bounce) your message. But the fact remains: all you can test before sending is whether or not the server is actually up.
     
    Farakh khan
    Ranch Hand
    Posts: 851
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Rob Prime:
    1) You can use the InternetAddress class and its constructors to verify email addresses.

    2) You can't determine whether or not a message will be bounced until the message is actually sent. There are multiple reasons a message can be bounced:

  • The email server does not exist. InetAddress.isReachable can help you with finding out.
  • The SMTP port is closed. Socket can help you with finding out. Of course a Socket can also help you find out if the email server exists; if it doesn't the socket will fail as well.
  • The mailbox is invalid for the mail server. You can't find out before sending.
  • The mailbox is full. You can't find out before sending.

  • This list is not exhaustive; there are probably dozens of more reasons a mail server can reject (bounce) your message. But the fact remains: all you can test before sending is whether or not the server is actually up.


    Thanks a trillion
     
    Bartender
    Posts: 9626
    16
    Mac OS X Linux Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Rob Prime:
    1) You can use the InternetAddress class and its constructors to verify email addresses.



    InternetAddress verifies addresses according to rfc 822 which does not require a top level domain for an address. For example, "joe" is perfectly valid under the rfc, but will probably not resolve to a destination.
     
    Rob Spoor
    Sheriff
    Posts: 22567
    122
    Eclipse IDE Spring VI Editor Chrome Java Windows
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Except when you use the strict flag, and set it to true. Of course saying things like rob@com will be allowed, but then again, technically it IS. A TLD is a domain, and technically the maintainers could put a mail server on that domain. Especially if TLDs will become for sale (which has already been the case in the past with a nasty company called UNIDT, and I've read there are similar plans again) that would be perfectly possible.
     
    Sheriff
    Posts: 26949
    83
    Eclipse IDE Firefox Browser MySQL Database
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Farakh khan:
    1) I am editing my message to make more to the point that I don't need any regex to check the syntax that it has @ and dot or not like these things.

    2) I need to know that how can decided about the email that it'll not be bounced?

    If you design your application correctly, you should not have to validate any e-mail addresses. Here's how you do that design: make sure that the user wants to receive e-mails from you. When that happens, the user will make sure to input his e-mail address correctly.

    If you have a design where you require an e-mail address, and the user isn't sure that he wants to get e-mails from you, the user is going to put junk in that field. If you try to validate it, the user will then put in valid-looking junk. So validation doesn't do anything for you there.
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic