bobheart Posted August 19, 2004 Share Posted August 19, 2004 I tried to do this and it says all the emails are all valid . lol $X = InputBox("Question", "email address to check?", "emailaddress@what.com", "", -1, -1, 0, 0)If IsValidSmtpAddress($X) Then MsgBox(0, "Testing", "Valid E-Mail address")Else MsgBox(0, "Testing", "Not Valid")EndIfFunc IsValidSmtpAddress($ADDRESS) Dim $I, $M Dim $NPOS, $NDPOS ;Valid format: alpha.numeric02@whereever.com $NPOS = StringInStr($ADDRESS, "@") If $NPOS = 0 Then Return 0;False For $I = 1 To $NPOS - 1 $M = StringMid($ADDRESS, $I, 1) Select Case StringIsAlNum($M);Alphanumeric - valid ; Do nothing Case StringInStr(".%_-", $M) > 0 ; Do nothing Case Else Return 0;False EndSelect Next ; Valid name, now for the domain. ; Find the .com, .net, etc. $NDPOS = StringInStr($ADDRESS, ".", 0, -1) if ($NDPOS < $NPOS) Then Return 0;False ;scan all characters For $I = $NPOS + 1 To StringLen($ADDRESS) $M = StringMid($ADDRESS, $I, 1) Select Case StringIsAlNum($M) ;Alphanumeric - valid ; Do nothing Case StringInStr(".%_-", $M) > 0 ; Do nothing Case Else Return 0;False EndSelect Next Return 1;TrueEndFunc ;==>IsValidSmtpAddress Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 Anyone ? Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 hehehe i tried to used autoit to delete files by a certain size. i ended up deleteing my whole harddrive by accident. are you sure you want my help? Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 hahahaha sure what the hell .. Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 Living Dangerously. ok i will try to help. let me reload autoit, and no it isn't from deleting my entire harddrive. lol had to reinstall windows because i got my own web site, and i need to learn php and other goodies as such. brb give me a sec. Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 rflmao i found your problem expandcollapse popup$X = InputBox("Question", "email address to check?", "emailaddress@what.com", "", -1, -1, 0, 0) Func IsValidSmtpAddress($ADDRESS) Dim $I, $M Dim $NPOS, $NDPOS ;Valid format: alpha.numeric02@whereever.com $NPOS = StringInStr($ADDRESS, "@") If $NPOS = 0 Then Return 0;False For $I = 1 To $NPOS - 1 $M = StringMid($ADDRESS, $I, 1) Select Case StringIsAlNum($M);Alphanumeric - valid ; Do nothing Case StringInStr(".%_-", $M) > 0 ; Do nothing Case Else Return 0;False EndSelect Next ; Valid name, now for the domain. ; Find the .com, .net, etc. $NDPOS = StringInStr($ADDRESS, ".", 0, -1) if ($NDPOS < $NPOS) Then Return 0;False ;scan all characters For $I = $NPOS + 1 To StringLen($ADDRESS) $M = StringMid($ADDRESS, $I, 1) Select Case StringIsAlNum($M);Alphanumeric - valid ; Do nothing Case StringInStr(".%_-", $M) > 0 ; Do nothing Case Else Return 0;False EndSelect Next Return 1;True EndFunc ;==>IsValidSmtpAddress If IsValidSmtpAddress($X) Then MsgBox(0, "Testing", "Valid E-Mail address") Else MsgBox(0, "Testing", "Not Valid") EndIf try that.. lol Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 i relocated your valid check, to the bottom. Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 Well I got the code from the v3 Scripts and Scraps froum that someone made but I soon saw that it didn't work . But thank you all give that a try . ' /me backs my drive before running code . heh heh Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 Glad i could help, without melting down autoit. Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 Still says any email address is valid . try @nothing.com Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 see the person who wrote this, forgot to put a nothing checker, if nothing is there, at the beginning of the @ then it should be invalid. if stringlen=0 then invalid. or something... Link to comment Share on other sites More sharing options...
bobheart Posted August 19, 2004 Author Share Posted August 19, 2004 I was wondered about that too . I tried to add something but just buggered it up . lol Link to comment Share on other sites More sharing options...
Somerset Posted August 19, 2004 Share Posted August 19, 2004 (edited) lol try this also. @. it is a valid email address. bob you can write a better than this. @. is all it looks for you know as well as i do it has to find everything.... scrap this script (suggested), and build a new one. Edited August 19, 2004 by beerman Link to comment Share on other sites More sharing options...
Nutster Posted August 20, 2004 Share Posted August 20, 2004 (edited) I did say that it was untested on the Scripts and Scraps forum when I wrote it. I will fix the version here to check for empty sections.Edit: Done. Edited August 23, 2004 by Nutster David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now