Open default mail client along with a attachment

前端 未结 4 958
生来不讨喜
生来不讨喜 2020-11-27 18:10

Hi I am working on a WPF application (using c#).

I need to have a functionality where users can send files (audio files) as attachments via email. I tried using

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 19:04

    Have you tried using System.Diagnostics.Process.Start() with an appropriate command line?

    mailto:some.guy@someplace.com?subject=an email&body=see attachment&attachment="/files/audio/attachment.mp3"
    

    The &attachment switch lets you specify a file name.

    Ok, I'm struggling to this working but allegedly it can be done. I'm currently reading through this monster and will get back to you.

提交回复
热议问题