Jump to content

Open Default Email Client with Attachment

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
brownhead

brownhead

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
I have a program that generates a report in a PDF file, and I want to add a button that says "Export and Email." This button will open a new mail window in the default mail client of the user with the PDF file prepared as an attachment. However I've been unable to find out how to do this. To open the default mail client I can simply use "mailto:bleh@blah.com." The mailto protocall doesn't seem to support attachments however because when I say "mailto:bleh@blah.com?attach=C:\\test.txt" the default client is opened up but no attachment is placed in the email.

Does anybody know how I can do this correctly? Or is it possible?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
I found this article, which may help you: .NET csharp Send an email with attachment through default email client

#3
smith

smith

    Programmer

  • Members
  • PipPipPipPip
  • 153 posts
I don't know how to do what you want. You could always send an email directly from C#.

for (int i;;) {

   cout << "Smith";

}


#4
brownhead

brownhead

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
Thanks Jordan, trying to decipher exactly what that code does, but I'm sure I'll figure it out. Thanks again.