How to send email using default email client?

前端 未结 4 1239
鱼传尺愫
鱼传尺愫 2020-11-30 08:04

I want to send an email from a .net windows forms application using the system\'s default email client (thunderbird, outlook, etc.). I\'d like to preset the subject and body

4条回答
  •  北海茫月
    2020-11-30 08:24

    This is what I tried:

    Process.Start("mailto:demo@example.invalid?subject=" +
        HttpUtility.HtmlAttributeEncode("Application error report") + 
        "&body=" + HttpUtility.HtmlAttributeEncode(memoEdit1.Text));
    

    But if the body text is too large I get the exception:

    Win32Exception "The data area passed to a system call is too small"

    So the question is still open since I need to handle long body text. I don't know the size limit for this error.

提交回复
热议问题