How can a Delphi Program send an Email with Attachments via the DEFAULT E-mail Client?

前端 未结 5 871
醉梦人生
醉梦人生 2020-12-24 15:31

Within my program, I am composing an email to send using the default e-mail client software installed on a user\'s machine.

I have composed the mailto address, the

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-24 15:46

    It appears that mailto in a ShellExecute is not capable of sending attachments.

    MAPI and Indy have the unfortunate characteristic of not necessarily selecting the user's email client.

    So the other possibility is to continue using ShellExecute, but find another way to get the attachments into the email client.

    What I decided to do was on my Dialog that creates the email, I now have a FileListBox listing the files the user may want to attach to the email. When the email pops up, they can simply drag and drop them to the email.

    In my case, this is actually a good solution, since this allows the users to select the files they want to include. The other method (automatically attaching them) will require they delete the ones they don't want included. (i.e. Having the "Add Google toolbar" option already checked for you is NOT good)

    For the time being this solution will work.

    Thank you to all those who contributed answers and helped me see my way through this (all +1).

提交回复
热议问题