Platforms to show: All Mac Windows Linux Cross-Platform

/Util/BugreporterKit/Send Email over Server


Required plugins for this example:

Last modified Sat, 18th Aug 2023.

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

Download this example: Send Email over Server.zip

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

Download this example: Send Email over Server.zip

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


The biggest plugin in space...