Check if valid email before add to DB

Hello, i want a class or JSP code for check if an email address submited by users is valid before add to database, sometimes the users send the email uncomplete or with errors and i want to depurate this.
If the email address is valid then add to DB, if not display the invalid email to the users and then they can fix the email error.
Thanks.

These's not too much you can test for. You can check for invalid characters (spaces etc.), the presence of an @ symbol and that the address has a length greater than 3 (a@a is the shortist possible valid address I can think of). The best way to do this is use the java regular expression stuff. Google for a pattern that matches email addresses and test this way.

Similar Messages

  • Checking the valid email add

    Dear all,
    I need to perform the check on a string where it contains email address.
    For eg:
    [email protected] - this is a valid email add
    @yaho.com - this is invalid email add
    qwertyuyu.com - this is invalid email add
    Do you think is there any standard FM can perform such check?
    Please comment.
    Thanks in advance.

    Hi,
    Please try this code. I hope it will meet most of your requirements.
    FORM check_email_val .
    DATA: lv_len type i,
          lv_len1 type i,
          lv_len2 type i,
          lv_char1,
          lv_char2(2) type c,
          lv_char3,
          lv_last_3 type i,
          lv_email(40) type c,
          lv_email_str(40) type c,
          lv_temp1(40) type c,
          lv_temp2(40) type c,
          lv_temp3(40) type c,
          lv_temp4(40) type c,
          lv_temp5(10) type c,
          lv_temp6(10) type c,
          lv_rev_str(20) type c,
          lv_last_4(4) type c,
          lv_flag1 type c,
          lv_flag2 type c,
          lv_flag3 type c,
          lv_str(6) type c.
    lv_email = zuserpass-email.
    lv_len = strlen( lv_email ).
    IF ok_code EQ 'PRO'.
    *check whether @ symbol is there, depending on flag validate any further
    IF lv_email CA '@'.
    lv_flag1 = 'X'.
    ELSE.
    lv_flag1 = ' '.
    Message S013(zusermsg). "Email ID must have a '@'
    Endif.
    IF lv_flag1 = 'X'.
    *split and check whether the split halves have any '@' or special characters leaving out '_' and '.'
    SPLIT lv_email at '@' INTO lv_temp3 lv_temp4.
    IF ( lv_temp3 CA '@~!#$%^&*()-={}}[]'',/?<>:"|\`' ) OR ( lv_temp4 CA '@~!#$%^&*()''-={}}[],/?<>:"|\`' ).
    Message S016(zusermsg). "Special characters except '_' , '.' , '@' are not allowed
    EXIT.
    ENDIF.
    *checking whether there is an '_' of '.' in immediate precedence to '@'
    *reversing lv_temp3 and taking its first character
    CALL FUNCTION 'STRING_REVERSE'
      EXPORTING
        STRING          = lv_temp3
        LANG            = sy-langu
      IMPORTING
        RSTRING         = lv_rev_str
    IF SY-SUBRC <> 0.
    ENDIF.
    *fetching the character just before '@'
    lv_char1 = lv_rev_str+0(1).
    IF ( lv_char1 EQ '_' ) or ( lv_char1 EQ '.' ).
    MESSAGE S021(zusermsg). "Cannot have '_' or '.' just before or just after '@'
    EXIT.
    ENDIF.
    *fetching the character just after '@'
    lv_char3 = lv_temp4+0(1).
    IF ( lv_char3 EQ '_' ) or ( lv_char3 EQ '.' ).
    MESSAGE S021(zusermsg).
    EXIT.
    ENDIF.
    *checking whether a '.' is present in lv_temp4
    IF lv_temp4 CA '.'.
    lv_flag2 = 'X'.
    ELSE.
    lv_flag2 = ' '.
    MESSAGE S020(zusermsg). "Email ID should have a '.'
    ENDIF.
    *further checking whether there is a '.' separating email id into two halves
    IF lv_flag2 EQ 'X'.
    SPLIT  lv_temp4 at '.' INTO lv_temp1 lv_temp2.
    IF lv_temp1 EQ ' '.
    MESSAGE S018(zusermsg). "Enter a valid portal name
    ENDIF.
    IF lv_temp2 EQ ' '.
    MESSAGE S019(zusermsg). "Domain name cannot be blank
    ELSE.
    lv_flag3 = 'X'.
    ENDIF.
    ENDIF. "end of flag2 IF
    *check for a valid domain
    IF lv_flag3 EQ 'X'.
    IF ( lv_temp2 CP 'com' ) OR ( lv_temp2 CP 'edu' ) OR ( lv_temp2 CP 'net' ) OR ( lv_temp2 CP 'org' ).
      LEAVE TO SCREEN 1003.
      ELSE.
    *if email ID is of type co.in
    IF lv_temp2 CA '.'.
    SPLIT lv_temp2 at '.' INTO lv_temp5 lv_temp6.
    IF lv_temp5 CP 'co'.
      lv_len1 = strlen( lv_temp6 ).
    the email ID should be of the form co.xx
      IF lv_len1 GT 2.
      MESSAGE S022(zusermsg). "Email Id will be of the form .com, .org, .net or .co.in or .co.uk etc.
      EXIT.
      ENDIF.
    checking whether the penultimate and the final character are alphabets
      lv_char2 = lv_temp6+0(2).
      IF ( lv_char2 NA 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' ).
      MESSAGE S023(zusermsg). "Invalid domain name
      ENDIF.
    LEAVE TO SCREEN 1003.
    ELSE. "to the 'co' IF
    MESSAGE S022(zusermsg). "Email Id will be of the form .com, .org, .net or .co.in or .co.uk etc.
    ENDIF. " end of 'co' IF
    ENDIF. "end of first IF
    ENDIF. "end of lv_temp CA '.'
    ENDIF. "end of flag3 IF
    ENDIF. "end of flag1
    ENDIF. "end of ok_code IF
    ENDFORM.                    " check_email_val
    Reward if Helpful.

  • How to check CRL validity Period before doing CA Migration ?

    Hi ALL,
    I am performing a CA migration so for doing that my first step is to
    Check that CRLs have a validity period that extends past expected migration duration
    So can any one please let me know how can I check the CRLS validity period ??
    If not, publish CRLs - ensure that published CRLs have a duration that is reasonably longer than the estimated duration of the migration.
    So can any one please let me know how can I should ensure that published CRLs have a duration that is reasonably longer than the estimated duration of the migration ??

    Why even try to determine what is remaining in the existing CRLs. Publish a new base/delta CRL period that will last the duration. For example, if you think it will take five days, then change the validity period for both the base and delta CRL to five days,
    publish a new set of CRLs, and do the migration.
    certutil -setreg CA\CRLPeriodUnits 5
    certutil -setreg CA\CRLPeriod "Days"
    certutil -setreg CA\CRLDeltaPeriodUnits 5
    certutil -setreg CA\CRLDeltaPeriod "Days"
    Restart ADCS
    Copy *.crl \\webserver\Share
    Just remember to change it back to your previous intervals
    after the migration.
    Brian

  • Any service available on net to check valid email addresses?jwenting, help.

    Is there any 100% reliable service available on net to check the valid email address so that the mail should not get bounced back if sent to the email id.
    According to jwenting in previous topic, there is one service. Here are his quotes.
    Spammers would love to have such a
    service. Just send random combinations to that
    service at a rate of a hundred thousand a minute and
    you have in a few hours a complete list of all
    working addresses on the net.
    Good enough that you can repeat the process before
    every run and you're never getting bounces again.Could anybody explain what is meant by this?

    He's saying "No there is no such service". It would provide yet another haven for crappy spammers.

  • Spell check emails before sending

    I believe this has been posted elsewhere, but I am wondering if anyone has found a way to make this happen?  Is this a possibility for future software upgrades?
    I do have the spell check feature turned on, and incorrect words are underlined in red, but I find the correction process cumbersome and really miss the option of spell-checking an entire email before sending it (which was available on my Bold 9900).
    Any advice would be appreciated.  Thanks. H

    If it helps at all to get this included in a future release we have several users who are used to this feature on their BB7 devices and sorely miss it on their BB10 devices.

  • How to filter/check outgoing email BEFORE it is sent?

    I want to write a set of rules to check outgoing email *before* it gets sent. For example: I have 2 contacts with very similar names and autocomplete occasionally means that I send an email to the wrong person. I want to be able to avoid potentially troublesome situations by specifying that an email with certain keywords never gets sent to specific addresses. I'd like a warning to pop up, or just to have the email shunted into a special local mailbox, if it meets certain conditions prior to being sent out. I am using Apple Mail and Outlook 2011 with an Exchange server. Is there any mail client, or script or extension that will allow me to check emails for specific things before they are sent out?

    Hi Raju,
    Try this.  Create another dataprovider within your web template?  This new dataprovider refers to a similar query, but this query definition should restrict values CG1, CG2, CG3 and CG4.  Assign this dataprovider to your checkbox.  Then make sure the properties of the checkbox affect all other dataproviders.
    Also, if this list is static, you could create an HTML checkbox object coding the options (cg1, cg2, cg3, and cg4) programmatically.  Then add javascript code to produce the proper filtering based on the users' selections.
    Let me know what happens.
    Larry

  • Check on vendor email address change before saving PO

    Hi All,
        I need to check Is there any change in Vendor Email address in PO before
    saving. I am trying to find userexits.
    I found some like EXIT_SAPMM06E_012, But here I am not getting complete
    Vendor address...
    Req: I am maintaing multiple email address for Vendor at PO header level.
    Here is the path:  PO Header --> Address tab --> Click on Address Details
    --> Here we can maintain(Insert/ Delete/Change) multiple e mail address.
    So I need to check is there any change in email address before saving.
    Could you please any body help me on this....
    Thanks
    Rays

    Hello Rays,
    One base question,
    Are you going to check the vendor email address manually before saving the PO?
    The vendor address in the puchase order is copied from the vendor master so you can maintain email address (single or multiple) in the vendor master before creating the purchase order. At the time of purchase order creation/save, you can change the default email address and use this to trigger PO to vendor.
    By the way, user exit EXIT_SAPMM06E_012  (Check Customer-Specific Data Before Saving) is used for custom field not for SAP std field.
    Hope this helps.
    Arif Mansuri
    Reward the points if answer is helpful.

  • Read email adress from a text file then check the validity of them

    a text file has three lines, each line contains one email adress:
    [email protected]
    qwe@@ws.com
    wer//@we.net
    read the email address from a text file, then check which one is invalid, output the invalid email adress in the console.

    no 3 .umm, an email adress can have more than 2 '.'s in it,
    example:
    [email protected]
    would be a valid email address.
    To decide what a valid address is you'd need to parse it against the correct standard.
    I think however that javax.mail.internet.InternetAddress does this for you, check out the docs:
    http://java.sun.com/products/javamail/1.2/docs/javadocs/javax/mail/internet/InternetAddress.html
    even if it parses it may not be a valid address though in that it may not actually exist.

  • Have a small notice telling me to enter a valid email with a box for me to check that says OK I have been clicking on the ok box and nothing is happening

    Please someone help me,
    I was trying to pay for something and when I attempted to put in my email  this small box appeared on the screen  asking me to enter a valid email address..
    There is a small box that you check that says OK.
    I have checked it for hours and nothing happens.
    So here I am on my old sony pc writing for help

    ...and on the form that you were trying to fill out, have you corrected anything that might be perceived as an invalid email address, such as not containing an @ somewhere in it, having spaces in it, or illegal characters?

  • How to check at replicat process a target conditional before add

    How to check on replicat , check on target table conditional before add data.
    Example :
    REPLICAT
      SOURCEDEFS /u01/app/oracle/ggs_2/dirdef/TABLE_SOURCE
    MAP  sourcet.table,target.table
    QUERY "SELECT A.COL3 FROM TABLE_SOURCE A, TABLE_DEST B where B.COL1=B.COL2"),
    COLMAP ( A.COL3, B,COL3);

    Thanks for you answers
    I mean someone like this :
    TARGET:  TABLE_C
    TABLE_A replicat direct to TABLE_C
    TABLE_B will replicat only if TABLE_A was replicated and have this values previus add with replicated TABLE_A
    how to check if TABLE_A was previously replicated?  is possible on Golden gate ?
    create or replace procedure oracle2.lookup_ACCOUNT(acc_code in varchar,acc_cta out number)
    as
    begin
    select count(*) into acc_cta from oracle2.TABLE_B where COLC_1 =acc_code AND COLC_2 =acc_code
    end;
    REPLICAT rload1
    USERID oracle2,PASSWORD extuser2
    SOURCEDEFS ./dirdef/defTABLE_A.def <  [TABLE_A + TABLE_B]
    DISCARDFILE ./dirrpt/rload1.dsc, PURGE
    MAP ORACLE.TABLE_A,TARGET ORACLE2.TABLE_C,&
    COLMAP(COLC_1=COLA_1,COLC_2=COLA_2,);
    MAP ORACLE.TABLE_B,TARGET ORACLE2.TABLE_C,&
    SQLEXEC (ID lookup,SPNAME oracle2.lookup_ACCOUNT , PARAMS (acc_code=TABLEA.COLA_1)),&
    FILTER (@GETVAL((lookup.acc_cta) > 0)),&
    COLMAP(COLC_3=COLB_1,COLC_4=COLB_2,);
    Thanks

  • How to automatically spell check emails before sending

    Hi. I have a Q10, and I was wondering how I can automatically spell and grammar check emails before sending. Currently, if a word is misspelled, I get a red underline, and most of the time, if I click on that word, I get this magnifying glass, which I have no idea what the magnifying glass is, and why that comes up instead of options for the spell check. Any help or advice would be greatly appreciated! Thanks!

    BB decided it would be nice to take this feature away. I do not think that there is ONE phone left on the market (other than an old BB) that has a good old fashioned spell check.  There are A LOT of unhappy BB users who really miss and relied on spell check/check spelling before sending.  Little things like this are what made BB's stand apart from other phones.  Now it's just a wanna be iphone

  • Check the validity of a SQL statement before execution

    Hi everyone,
    In an applet I have created, I am allowing the user to create a SQL statement which will be sent to a servlet that in turn issues the JDBC request for the SQL statement. My concern is that since my GUI lets the user create more or less any kind of SQL statement (including an illegal one) I need to verify if the user has created the correct SQL. How can this be achieved?
    To recapitulate and summarize, I need to know how I can check the validity of a SQL statement without actually executing it and handling the SQLException. FYI, I am using the mm-mysql driver.
    Thanks,
    Alan

    jschell is correct. Unless you're writing something like an ISQL tool you want to be very careful doing this.
    Having said that Mimer SQL have SQL validators that may do what you want http://developer.mimer.com/validator/index.htm
    They've also got the SQL Validator running as a web service that you can use. Theres example code here showing how to use it.
    http://sqlvalidator.mimer.com/index.html
    At the risk of being accused of selfpromotion you can check out the SQL Validator plugin for SQuirreL SQL CLient. This is a fully functional example of using the Mimer SQL Validation web service. http://squirrel-sql.sourceforge.net/
    Col

  • Campaigns - Hard bounces for valid email addresses

    I am getting hard bounces with 'Bad Mailbox Destination Address' for valid email addresses that everybody internally and externally can email without problem.
    Doesn't instill me with much faith for sending out 10,000 emails next week!

    If you can email that address manually from a regular email address and it goes through fine then it's likely you might be getting blocked by spam filters although usually that would be indicated in your bounce message.
    Is your site fully hosted on BC (ie - with BC's nameservers) or is your domain hosted via an A record to point to BC?  If you are being blocked by spam filters then you are likely using the A record because fully hosted sites on BC have the SPF records in place.
    If you are using an A record to point to BC's servers for your domain and manage your DNS records somwehere then you need to add a TXT record with the SPF data.  Goto your domain registrar and manage your DNS entries.  You'll want to add a TXT record with the following info:
    Record name: @
    Record type: TXT
    Record value: v=spf1 mx include:worldsecuresystems.com ~all
    Record TTL: 86400
    You can only have one SPF record on your domain so if you already have a TXT record with SPF data in it for other email services your domain uses (like gmail) you just need to update your TXT SPF record and add "include:worldsecuresystems.com" after the first "include" statement in the TXT record the TXT value would look like:
    "v=spf1 mx include:_spf.google.com include:worldsecuresystems.com ~all"
    If your problem is that your emails are blocked by spam filters that should fix it but I'm pretty sure 'Bad Mailbox Destination Address' usually indicates a non-existent or malformatted username in your email address (ie - the part before the "@").  I would also double check your subscribers list and make sure there are no spaces or any other invalid character in the email addresses for the customers that are getting bounced back.
    Here's more information about your specific error from http://technet.microsoft.com/en-us/library/bb232118(v=exchg.80).aspx which has to do with MS Exchange server specifically but still provides a good explanation:
    5.1.1
    Bad destination mailbox address
    This failure may be caused by the following conditions:
    The recipient e-mail address was entered incorrectly by the sender.
    No recipient exists in the destination e-mail system.
    The recipient mailbox has been moved and the Microsoft Office Outlook recipient cache on the sender's computer has not updated.
    An invalid legacy domain name (DN) exists for the recipient mailbox Active Directory.
    This error typically occurs when the sender of the message incorrectly enters the e-mail address of the recipient. The sender should check the recipient's e-mail address and send again. This error can also occur if the recipient e-mail address was correct in the past but has changed or has been removed from the destination e-mail system.
    If the sender of the message is in the same Exchange organization as the recipient, and the recipient mailbox still exists, determine whether the recipient mailbox has been relocated to a new e-mail server. If this is the case, Outlook may not have updated the recipient cache correctly. Instruct the sender to remove the recipient address from sender's Outlook recipient cache and then create a new message. Resending the original message will result in the same failure.
    Other issues may cause this error, such as an invalid legacy distinguished name (DN) in Active Directory. Examine and correct the legacy DN of the recipient's mailbox. Then instruct the sender to remove the recipient address from sender's Outlook recipient cache and then create a new message. Resending the original message will result in the same failure.

  • Does anyone know how to get my email to download pictures?  I was able to view pictures in my email before I upgraded to iOS 7.  I have allow remote pictures turned on in my settings.

    I was able to view pictures in my email before I upgraded to iOS 7.  I have allow remote pictures turned on in my settings.  I loved Apple until this last upgrade.  It used to be an intuitively designed product.  I hate it now.  If they don't make it easier for older users to use again, this will be the last Apple product I every purchase.

    Welcome to AD!
    I have a regular post for the top 3 or 4 fixes for that 9808 error. Obviously you are going to skip #1, since you've already tried it. Let me know how you get on with the next 2.
    The top 3 fixes to itunes error 9808 seem to be
    1) Go to Start > Control Panel > Internet Options > Advanced, make sure that SSL 3.0 is checked and TLS 1.0 is checked. Also under Security make sure that the “Check for server certificate revocation (requires restart)” is unchecked. Then click ok and fire up iTunes.
    2) The culprit was Norton. The users are set up as Admin and Standard. I have Parental Controls turned on in both Vista as well as Norton. Admin users had no problems connecting to iTunes. Standard users would get the error. I had to go to Norton’s Personal Firewall and add the program “iTunes Helper.exe” and set the option to “Allowed” (”iTunes.exe should already be in the Allowed category.) in order for the standard users to be able to connect.
    3) close iTunes if you have it open right now. Then go to C:/Documents and Settings/username/Local Settings/Application Data/Apple Computer/iTunes. Delete or cut the preferences.xml file which contains your iTunes preferences. Then go to C:/Documents and Settings/username/Application Data/Apple Computer/iTunes and delete or move the preferences.xml file. For Mac users, there is only one file you must delete or move a to a new location and is located at User > Library > Preferences > com.apple.itunes.plist. Restart iTunes and it will recreate those two (or one) files with the default settings. Feel free to set your preferences back to what they were and then connect to the iTunes store and enjoy!
    And #4, see if you can get into the iTS from a different windows admin account on the same PC.

  • JavaMail and Valid Email Address

    Hello All,
    I am using JavaMail API to send thousands of emails every day through my application running on J2EE application server...
    But what i really want to do is, how do i check whether a particular Email Address is Valid or not,if not valid then catch a exception and report it....
    Also i meant by Valid email address as to be exsisting on that mail server..e.g "[email protected]"...i.e.the user "javamail" should exist on that domain "sun.com"...
    Is there any way which i can do the above thing?
    Also,since i will be sending 1000's of emails every day will it be feasible for me to check each and every email whether it exist or not and then send it.....how much time will it take to do the same...
    Please help me out with this,can anybody give me a Detail desciption and Code of how can i do it...
    Any suggestions are greatly appreciated
    Thanks a million is advance
    Sam

    E-mail generally passes through a whole series of Mail Transfer Agents before arriving on the target machine, and it could be rejected at any stage.
    It may wind up waiting in a queue. It could be days before it reaches a machine that knows whether the user is valid or not.
    And machines aren't as helpful as they used to be about letting out information about available e-mail addresses,
    too many evil spammers about.
    You can test the format, though I've seen a lot of active e-mail addresses with what I believe are invalid characters in them apparently find their way through.
    In theory you could look up the domain part of the address on the DNS. If you don't find either an "A" record or a "MX" record then niether will your mail transfer agent. AFAIK there's no standard java classes for doing that but there may be some out there on the net.
    There's no sure way of validating a user name except sending a mail and see if it bounces.

Maybe you are looking for

  • ITunes won't open (this isn't an idiot question)

    When I first got my iPod mini, I set everything up the way I wanted it and iTunes would open every time I plugged my iPod in. It was beautiful. Now, even though I didn't change anything to my knowledge, iTunes won't open when I plug my iPod into my c

  • CREATION OF NEW MOVEMENT TYPE

    Hi,        I have a query regarding creation of a new Movement Type. Is there any specific rule to start creating new Movement Type only with numbers starting with digit 9 or we can consider numbers starting with any digits. Please clarify this as so

  • Is it possible for and iPhone 4 to get a virus?

    Is it possible for an iPhone 4 to get a virus? If so how would you remove it ? My mother was told she had a virus on her iPhone 4. In my experiences with the iPhone I have never seen this! She has the 4 with the latest update for them.

  • Download Image with DBMS_LOB

    I want to download the image file stored in database with the DBMS_LOB package within the forms 6i application. The DBMS_LOB.READ can do this but the buffer limit is 32kB! The image file I want to download is with size over 10MB, so that I need to wr

  • How to set Application Language in JHeadstart Generated Applications

    Hi Everybody, We have developed an application using jheadstart 10.1.2 and (UIX/Struts/BC4J). I have a table for users preference and I want to enable users to choose their desired language. For example, If user select "Arabic" as his preference, app