Hello, I have a question that is more complex than I thought

Hello, I have a question that is more complex than I thought

On a Delphi software with a mail function, the body is a TMemo and it's possible to add attachments.

the mail can be sent with SMTP (IdSMPT) or through MAPI (JvMail).

Now I have a request for HTML Support...for the SMTP part it's not a problem, but MAPI do not know HTML, especialy with embedded images and attachments.

I've tried to create an .EML file, but ShellExecute() open it as an incoming mail, not a mail to send.

So is there an easer solution than adding an IMAP request to put the sent mail in the outbox ?

Of course I don't know the mail software that will be used (ThunderBird, Windows Mail, Outlook...), that's why MAPI/ShellExecute looks great at first.

Thanks.

Comments

  1. Ondrej Kelle my request is not how to send a mail with SMTP, but how to have this mail in outbox of the mailclient.
    As far as I can see the only valid option for HTML mail is to use IMAP to save the sent mail.

    ReplyDelete
  2. Sorry, I didn't get that part of your question. Yes, using IMAP will save the mail on the server. Any IMAP client can later retrieve it.

    ReplyDelete
  3. support.microsoft.com - support.microsoft.com/am-et/help/268440/info-mapi-is-not-suitable-for-html-messages

    I use Rapware Easy Mapi (https://www.rapware.com/index.php?page=mapi-introduction) to send mails via MAPI client but html emails are possible only with Ms Outlook. Easy Mapi use extended Mapi to handle Ms Outlook.

    ReplyDelete
  4. Davide Angeli I've found a solution (not tested under Outlook)

    with TIdMessage add an ExtraHeader 'X-Unsent: 1', save the mail to a file and ShellExecute it :)

    there's an addon for Thunderbird to support that
    https://github.com/lieser/X-Unsent_support

    ReplyDelete

Post a Comment