Jump to content

dmob

Active Members
  • Posts

    501
  • Joined

  • Last visited

Community Answers

  1. dmob's post in solved --how to return several values as an array? was marked as the answer   
    Create the array before the While loop. Copy the values into the array before Return.
  2. dmob's post in Unexpected Ubound result was marked as the answer   
    I figured that was the only option. Kinda hard to wrap my head around, I thought a 1D array as in array[4] has 1 column, now I gotta learn it has 0 columns
  3. dmob's post in Grab TEXT from GUI then send info via email was marked as the answer   
    A suggestion...
    TCPStartup() $Form2 = GUICreate("Support", 301, 328, 544, 179) $Label1 = GUICtrlCreateLabel("SFE", 32, 32, 84, 17) $Label2 = GUICtrlCreateLabel("HostName", 32, 72, 84, 17) $Label3 = GUICtrlCreateLabel("IP", 32, 112, 84, 17) $Input1 = GUICtrlCreateInput("SFE Number", 128, 32, 129, 21) $Input2 = GUICtrlCreateInput(@ComputerName, 128, 72, 129, 21) $Input3 = GUICtrlCreateInput("", 128, 112, 129, 21) $Button1 = GUICtrlCreateButton("Collect Info", 32, 216, 81, 33) $Button2 = GUICtrlCreateButton("Send Info", 152, 216, 105, 33) $Progress1 = GUICtrlCreateProgress(32, 280, 225, 17) $Combo1 = GUICtrlCreateCombo("Select Issue", 128, 152, 129, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData($Combo1, "Avaya|C4 - Cant Login", "item3") GUICtrlSetData($Combo1, "C4 - Cant Open|C4 - Account Search", "item4") GUICtrlSetData($Combo1, "No Calls|Inbound", "item5") GUICtrlSetData($Combo1, "Outbound|Headset ID in Use", "item6") GUICtrlSetData($Combo1, "Zioper|C4", "item7") GUICtrlSetData($Combo1, "Zioper|C4", "item8") $Label4 = GUICtrlCreateLabel("Problem:", 32, 152, 76, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE TCPShutdown() Exit Case $Button1 GUICtrlSetData($Input3, TCPNameToIP(GUICtrlRead($Input2))) Case $Button2 ;#GUICtrlSetData($Input2, "") GUICtrlSetData($Input3, "") Local $aParameters[4] ; create array to pass info to func $aParameters[0] = GUICtrlRead($Input1) ; SFE Number $aParameters[1] = GUICtrlRead($Input2) ; HostName $aParameters[2] = GUICtrlRead($Input3) ; IP address $aParameters[3] = GUICtrlRead($Combo1) ; Issue SendMail($aParameters) ; call function passing array containing collected info EndSwitch WEnd Func SendMail($aInput) ; SFE Number is in $aInput[0] ; HostName is in $aInput[1] ; IP address is in $aInput[2] ; Issue is in $aInput[3] $s_SmtpServer = "0.0.0.0" $s_FromName = "localhost" $s_FromName = "Bertus" $s_FromAddress = "notification@test.com" $s_ToAddress = "bertusn@test.com" $s_Subject = "Nature or discription of Problem" ; Nature of Problem as Subject ; now you can construct your subject and body using values in $aInput Dim $as_Body[2] $as_Body[0] = "IP/Hostname/SFE" ; Details in Body $as_Body[1] = "Nature or discription of Problem" ; This line not as important $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) $err = @error If $Response = 1 Then MsgBox(0, "Success!", "Info sent") Else MsgBox(0, "Error!", "Mail failed - Please retry or call Support" & $err) EndIf EndFunc
  4. dmob's post in Timer made from array / listview items? was marked as the answer   
    Tried your script with my copy and got no errors. Sorry I can't remember what I had changed (if anything).
    _Adlib.au3
×
×
  • Create New...