Using Progress Bar with SMTP

Well, I’ve got my first Xojo Web app successfully creating a CSV export file and sending it as an attachment via email. Now I’d like to find out how I get feedback from the SMTPSecureSocket.

For instance, how do I get authentication error messages?

And how do I determine when the send is done, so I can close the Progress Bar? The Progress Bar shows up in the last three lines of the send method:

socket1.messages.append mail ProgressBar1.visible = True socket1.sendMail

That obviously starts the Progress Bar, but never ends it. How do I get feedback from the SMTPSecureSocket to handle that?

Check out http://documentation.xojo.com/index.php/TCPSocket.SendProgress .

I think the problems I’m having here are because I can’t put an SMTPSecureSocket object on a Web page in Xojo (not available in it Library). As a result, I can’t figure out how to employ Event Handlers for it.

Can you subclass the socket?

Use addhandler http://documentation.xojo.com/index.php/Addhandler.

You can also create an object this way :

  • Insert a class
  • Make it’s super SMTPSecureSocket
  • Drag it over the WebPage

After reading Beatrix’s suggestion about subclassing, I thought about what that meant and figured it out. I ended up doing exactly what Michel just suggested. I think this should make things easier.