Example: /Util/BugreporterKit/Send Email over Server

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/BugreporterKit/Send Email over Server


You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/BugreporterKit/Send Email over Server

This example is the version from Sat, 18th Aug 2023.

Project "Send Email over Server.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Const kInternetTrouble = "There is a problem with the internet connection. You can now save the report and send it manually by email."
Const kScriptURL = "http://www.monkeybreadsoftware.de/cgi-bin/bugreporter.php"
Control sock Inherits HTTPSocket
ControlInstance sock Inherits HTTPSocket
EventHandler Sub Connected() if status<>nil then status.text="Connected" end if End EventHandler
EventHandler Sub Error(code as integer) if code=102 then // ignore elseif code=103 then HaveInternet=false MsgBox kInternetTrouble elseif status<>nil then status.text="Error: "+str(code) end if End EventHandler
EventHandler Sub PageReceived(url as string, httpStatus as integer, headers as internetHeaders, content as string) #Pragma Unused url #Pragma Unused headers If status<>Nil Then status.text="Page Received: "+str(httpStatus) end if if left(content,2)="OK" then status.Text = "Sent." 'close Return end if End EventHandler
End Control
Control status Inherits Label
ControlInstance status Inherits Label
End Control
Control InputText Inherits TextArea
ControlInstance InputText Inherits TextArea
End Control
Control SendButton Inherits PushButton
ControlInstance SendButton Inherits PushButton
EventHandler Sub Action() dosend End EventHandler
End Control
Private Sub DoSend() dim dic as new Dictionary dic.Value("text")=InputText.Text sock.SetRequestContent "","" sock.SetFormData dic sock.Post(kScriptURL) End Sub
Note "Note"
As Bugreporter already uses a script to send email, you can of course also use it to send any text to home.
Property Private HaveInternet As Boolean
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

The items on this page are in the following plugins: MBS Util Plugin.


💬 Ask a question or report a problem