Send email from webapp that does not have a webpage

I have a webapp on my server that just sits and listens for requests from my mobile apps.
Now I would like for that webapp to send me an email when a specific request is made. How can I send an email if the webapp does not display a webpage? I do have MBS plugins if that helps.
Any hints at all would be helpful.

Hi Gary, this is actually pretty simple. It’s almost easier to do than to explain, but I’ll give it a try!

I usually create a Module in my Web project and call it “Messenger”. I add a class and call it “MailSocket” as a subclass of SMTPSecureSocket.

If you are deploying on TargetXojoCloud then there is a simple call that opens a port on their system (I can paste that to you if you need it). Here’s the basic idea…

For testing create a method in your app somewhere, like this:

// Create EmailMessage
Var mail As New EmailMessage
mail.FromAddress = "John Doe <>"
mail.Subject = "Hello it's my subject!"
mail.BodyHTML = Messenger.msg_template_GENERIC_html
mail.BodyPlainText = Messenger.msg_template_GENERIC_plaintext
mail.Headers.AddHeader("X-Mailer","if you want a header you can put on in")

Inside your Messenger.Outbox(msg as EmailMessage) looks like this:

EmailSocket = New MailSocket

// Connect to Server
EmailSocket.Address = ""
EmailSocket.Port = 465
EmailSocket.ConnectionType = SMTPSecureSocket.TLSv11
EmailSocket.SMTPConnectionType = SMTPSecureSocket.SMTPConnectionTypes.SSLTLS
EmailSocket.SSLEnabled = True

EmailSocket.Username = ""
EmailSocket.Password = "yourP4sswORdHere"

// Send it

That is great, I never thought about a module for this.
Thanks for the reply and I will add that to my Web app.