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.
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.
Ondrej Kelle my request is not how to send a mail with SMTP, but how to have this mail in outbox of the mailclient.
ReplyDeleteAs far as I can see the only valid option for HTML mail is to use IMAP to save the sent mail.
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.
ReplyDeletehaha 16 years old bug (missing feature) in Thunderbird :)
ReplyDeletehttps://bugzilla.mozilla.org/show_bug.cgi?id=166541
support.microsoft.com - support.microsoft.com/am-et/help/268440/info-mapi-is-not-suitable-for-html-messages
ReplyDeleteI 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.
Davide Angeli I've found a solution (not tested under Outlook)
ReplyDeletewith 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
Paul TOTH interesting!
ReplyDelete