Forums Register Login

Before Sending Emails

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
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.
    +Pie Number of slices to send: Send
     

    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
    +Pie Number of slices to send: Send
     

    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.
    +Pie Number of slices to send: Send
    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.
    +Pie Number of slices to send: Send
     

    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.
    Replace the word "snake" with "danger noodle" in all tiny ads.
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 1177 times.
    Similar Threads
    Edit first message on a post
    Can we make a deal?
    WSDL - Message parts
    Ways to display error messages
    Local Language XML parsing
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 19, 2024 02:43:25.