Can you save a XOJO created Email as a physical file?

I regularly send emails and attachments using XOJO. Can the email be ‘saved as a message’ to create a physical file?

For example, in most email programs (WINDOWS) you can drag an email from inside them, drop it on the desktop and it is a standalone ‘message’ file complete with attachments. Double-click it and it opens the email in the host email program.

I regularly save and drag these emails to a membership system I have developed, a record is created in the database and a link to the actual file path within the ‘document storage’ is created once the files is copied there after drag and drop.

I now want to do the same with emails which I send direct from within the XOJO system using a template system linked to the database instead of using the external email program.

So workflow;

  • Create mail message
  • Add Attachments
  • Save message as a separate file for later recall
  • Email the message
  • Repeat

All suggestions welcome.

Just look the standar for the file format you need and make an app that can write the file using that specification. Most common file must be the EML file.

I save all mine in SQLite databases.

If OTOH you want to save as text, you probably want the mboxrd format. When an email is sent over the wire, it will be in something close to mboxrd format.

Single email = eml, emlx
Multiple emails = mbox

It’s been so long since I tried to use Xojo for sending emails. The Chilkat plugin has the methods saveEml and LoadEml for the Email class.

Joe Strout once wrote an open-source email client in Xojo … Zymail?

Thanks for the replies, the short answer seems to be that its not possible so I will just save the text and list of attachments in the database.

It is possible, just requires work. I have written a free email client in Xojo.

1 Like