bobheart 0 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 Share this post Link to post Share on other sites
Somerset 3,041 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? Spoiler Share this post Link to post Share on other sites
bobheart 0 Posted August 19, 2004 hahahaha sure what the hell .. Share this post Link to post Share on other sites
Somerset 3,041 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. Spoiler Share this post Link to post Share on other sites
Somerset 3,041 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 Spoiler Share this post Link to post Share on other sites
Somerset 3,041 Posted August 19, 2004 i relocated your valid check, to the bottom. Spoiler Share this post Link to post Share on other sites
bobheart 0 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 Share this post Link to post Share on other sites
Somerset 3,041 Posted August 19, 2004 Glad i could help, without melting down autoit. Spoiler Share this post Link to post Share on other sites
bobheart 0 Posted August 19, 2004 Still says any email address is valid . try @nothing.com Share this post Link to post Share on other sites
Somerset 3,041 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... Spoiler Share this post Link to post Share on other sites
bobheart 0 Posted August 19, 2004 I was wondered about that too . I tried to add something but just buggered it up . lol Share this post Link to post Share on other sites
Somerset 3,041 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 Spoiler Share this post Link to post Share on other sites
Nutster 3 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 ConsultingAn Aquarius born during the Age of AquariusAutoIt allows me to re-invent the wheel so much faster.I'm off to write a wizard, a wonderful wizard of odd... Share this post Link to post Share on other sites