How to verify the format of email address
I am verifying error message which is thrown as "email format is wrong" if wrong email address is entered.
If fate means you to lose, give it a good fight anyhow
my first idea was:
<font class="small">Code:</font><hr /><pre>
[-] if(MatchStr("*@*.*", sEmail) != TRUE)
[ ] logError("Email format not valid!")
But it only checks if there is an @ and a . in the address
That is also possible: email@example.com
There you might need some extra-checks...
-----BEGIN GEEK CODE BLOCK-----
GIT d- s-:- a-- C++ U++ P+ L++
E--- W+++ N w O- PS+ PE- PGP+
t-- R tv+ b+++ DI++++ D+ G++ e*
------END GEEK CODE BLOCK------
Check @ and after than there is at least 1 dot (.)
no special characters except: - . _
rfc3696 4.3. The MAILTO URL. (http://tools.ietf.org/html/rfc3696#page-9)
Why are u even verifying if the email address is entered correctly??? There is already a script that is implemented in your application to do so.
All you need to do is to run your automation with a combination of valid/invalid email IDs and verify if an error is encountered every time an invalid ID is inputted by the script.