Shyke Posted October 22, 2007 Share Posted October 22, 2007 I'm looking for a way to have my software report errors to me on the AutoIt.Error event. My idea was FTP or email. I believe the most efficient way to have it done would be email but I don't know of a way to dynamically retrieve a SMTP server and using AutoIt to login to FTP or email wouldn't be very secure. Does anyone have any idea what the most efficient way to do this and how to do it? $oError = ObjEvent("AutoIt.Error", "_ReportError") Func _ReportError() $sReportErrorMessage = "Error Number: " & $oError.number & @CRLF $sReportErrorMessage &= "Description: " & StringStripWS($oError.description, 2) & @CRLF $sReportErrorMessage &= "WinDescription: " & StringStripWS($oError.Windescription, 2) & @CRLF $sReportErrorMessage &= "Error Source: " & $oError.source $iReportErrorQuestion = MsgBox(52, "", "An error has occured!" & @CRLF & @CRLF & "Would you like an error report to be sent?") If $iReportErrorQuestion = 6 Then ; CODE TO SEND ERROR HERE! YOUR HELP IS NEEDED!! EndIf EndFunc Link to comment Share on other sites More sharing options...
BrettF Posted October 22, 2007 Share Posted October 22, 2007 (edited) Let Me think about this... It is defiantly possible using email. I'll work out something, and get back to you Maybe Something like? expandcollapse popup#include <GUIConstants.au3> #Include <Date.au3> #include <INet.au3> $oError = ObjEvent("AutoIt.Error", "_ReportError") _ReportError() Func _ReportError() $sReportErrorMessage = "Error Number: " & $oError.number & @CRLF $sReportErrorMessage &= "Description: " & StringStripWS($oError.description, 2) & @CRLF $sReportErrorMessage &= "WinDescription: " & StringStripWS($oError.Windescription, 2) & @CRLF $sReportErrorMessage &= "Error Source: " & $oError.source & @CRLF $sReportErrorMessage &= "Computer Name: " & @ComputerName & @CRLF $sReportErrorMessage &= "Working Dir: " & @WorkingDir & @CRLF $sReportErrorMessage &= "Username: " & @UserName & @CRLF $sReportErrorMessage &= "Program Dir: " & @ScriptDir & @CRLF $sReportErrorMessage &= "Time: " & _Now() & @CRLF $iReportErrorQuestion = _ErrorBox($sReportErrorMessage) If $iReportErrorQuestion = 1 Then $s_SmtpServer = "mail.server.com" $s_FromName = "Your Name" $s_FromAddress = "errors@example.com" $s_ToAddress = "youremail@email.com" $s_Subject = "ERROR: " & $oError.number & " (" & _Now() & ")" $as_Body = $sReportErrorMessage _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body) EndIf EndFunc ;==>_ReportError Func _ErrorBox($err) $Form1 = GUICreate("Error", 311, 211, 309, 243) $descript = GUICtrlCreateLabel("An error has occured!" & @CRLF & @CRLF & "Would you like an error report to be sent?", 4, 4, 299, 41) $errortext = GUICtrlCreateEdit("", 4, 52, 301, 125) GUICtrlSetData(-1, $err) $sendy = GUICtrlCreateButton("Send", 232, 180, 75, 25, 0) $sendn = GUICtrlCreateButton("Don't Send", 152, 180, 75, 25, 0) GUICtrlSetTip(-1, "Do not send the error report") GUISetState(@SW_SHOW) $ret = -1 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $sendy $ret = 1 ExitLoop Case $msg = $sendn $ret = 0 ExitLoop EndSelect WEnd GUIDelete($Form1) Return $ret EndFunc ;==>_ErrorBox EDIT: Fixed up code... Edited October 22, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shyke Posted October 22, 2007 Author Share Posted October 22, 2007 I already had something simmalar to that done, the issue is that I don't have a way to dynamically retrieve the user's SMTP server, nor do I have a global SMTP server to use. Link to comment Share on other sites More sharing options...
BrettF Posted October 22, 2007 Share Posted October 22, 2007 #include <INet.au3> _INetMail ( $s_MailTo, $s_MailSubject, $s_MailBody ) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shyke Posted October 22, 2007 Author Share Posted October 22, 2007 Not everyone has a ISP SMTP address in their native email client. Using _INetMail() makes it situational as well as cumbersome and annoying for the user. Link to comment Share on other sites More sharing options...
BrettF Posted October 22, 2007 Share Posted October 22, 2007 Do you have a website with php? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shyke Posted October 22, 2007 Author Share Posted October 22, 2007 Sadly, GooglePages is at the highest of my resources currently. Link to comment Share on other sites More sharing options...
BrettF Posted October 22, 2007 Share Posted October 22, 2007 I take it you have Gmail Then?You can use your own account to send an email to yourself using this UDF by Jos. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shyke Posted October 22, 2007 Author Share Posted October 22, 2007 (edited) A packet sniffer will retrieve your username and password leaving this system insecure. Edited October 22, 2007 by Shyke Link to comment Share on other sites More sharing options...
BrettF Posted October 22, 2007 Share Posted October 22, 2007 Packet Sniffer? Where? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Shyke Posted October 22, 2007 Author Share Posted October 22, 2007 Nevermind, SSL takes care of that threat. 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