Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Validate if user entering the right email address format

$
0
0
Hi, i've created a simple program, asking user to enter his/her email address, e.g dannyd_y@hotmail.com
Or user can enter multiple email addresses, dannyd_y@hotmail.com;dannyd_yq@yahoo.com.


[ autoit ]         
Func mainlobby() Global $msg, $receiver local $sendemilbutton,$recipientsread,$recipientsenter GUICreate($toolname,$width, $height, 500, 250, -1, $WS_EX_ACCEPTFILES) ; will create a dialog box that when displayed is centered GUISetBkColor(0x6666FF) $recipientsenter = GUICtrlCreateInput("", 10, 5, 250, 20) $sendemilbutton = GUICtrlCreateButton("Send Email", 230, 128, 70, 25,-1,0x00000001) GUISetState(@SW_SHOW) do $msg = GUIGetMsg() Select Case $msg = $sendemilbutton if GUICtrlRead($recipientsenter) ="" Then msgbox(16,"Email Not Input","Cannot Find Any Email") Else msgbox(0,"Email Input",GUICtrlRead($recipientsenter)) $receiver = GUICtrlRead($recipientsenter) CreateMailItem() EndIf EndSelect Until $msg = $GUI_EVENT_CLOSE GUIDelete() _Exit() EndFunc


How do i validate if user is entering the right format. i've made some studies on this it seems like the right way of coding is using StringRegExp, but i coudlnt understand the regular expression pattern at all. Appreciate someone can help me. Many Thanks.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>