#include <GUIConstants.au3>
Opt ("GUIOnEventMode",1)
$var = 1
$pause=False
$Mail = GUICreate("邮件发送", 450, 500)
GUISetOnEvent ($GUI_EVENT_CLOSE,"_exit")
$Group1 = GUICtrlCreateGroup("基本配置", 8, 8, 330, 300)
$SmtpServer_Label = GUICtrlCreateLabel("SMTP服务器", 20, 40, 80, 20)
$UP_Label = GUICtrlCreateLabel ("用户名/密码", 20, 70, 80, 20)
$FromAddress_Label = GUICtrlCreateLabel ("From", 20, 100, 80, 20)
$To_Label = GUICtrlCreateLabel ("To", 20, 130, 80, 20)
$Subject_Label = GUICtrlCreateLabel ("标题", 20, 160, 80, 20)
$Body_Label = GUICtrlCreateLabel ("正文", 20, 190, 80, 20)
$Start_Label = GUICtrlCreateLabel ("起始", 20, 360, 80, 20)
$Start_Label = GUICtrlCreateLabel ("数量", 80, 360, 80, 20)
$SMTP = GUICtrlCreateInput ("", 100, 40, 220, 20)
$Username = GUICtrlCreateInput ("", 100, 70, 100, 20)
$Password= GUICtrlCreateInput ("", 220, 70, 100, 20,0x0020 )
$From= GUICtrlCreateInput("", 100, 100, 220, 20)
$To =GUICtrlCreateInput("", 100, 130, 220, 20)
$Subject =GUICtrlCreateInput("subject", 100, 160, 220, 20)
$Body = GUICtrlCreateEdit("Mail Body", 100, 190, 220, 100)
$Start = GUICtrlCreateButton("Start", 340, 200, 70)
GUICtrlSetOnEvent (-1,"_start")
$Stop = GUICtrlCreateButton("Stop", 340, 280, 70)
GUISetState(@SW_SHOW)
While 1
Sleep (1000)
WEnd
Func _exit ()
Exit
EndFunc
Func _start ()
$time = TimerInit ()
While Int(TimerDiff ($time)/1000) <= 1000
Opt ("GUIOnEventMode",0)
ToolTip ("Send")
;sendmail ()
If $pause == True Then
GUICtrlSetBkColor ($stop,0xff0000)
Else
GUICtrlSetBkColor ($stop,0x00ff00)
EndIf
$msg = GUIGetMsg()
if $pause=true then
$pause = Not $pause
Opt ("GUIOnEventMode",1)
exitloop
EndIf
Switch $msg
Case $Stop
$pause = Not $pause
EndSwitch
WEnd
EndFunc
Func sendmail ()
;.....发送邮件
EndFunc