You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/BugreporterKit/Send Email over Server
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"
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