C# and attachments
-
I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex
-
I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex
What do you mean by "pops"?? How are you accomplishing what you already have?? If it's launching a "mailto:" link, attachments are not supported.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex
-
I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex
If I were you I'd use the .NET API to achieve your goal. See here: MailMessage Class[^]. It even sports an example with an Attachment[^]. Regards,
— Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
-
I wrote an application which "pops" the local mail agent, fills out the recipients,cc,bcc,subject, and body fields.. question is, given a file path,how do i automate the process of attaching a file to that email and sending it? Scoured the web without finding a solution, So help will be greatly appreciated annex
You don't mention if but if you are working with Outlook as the local mail agent, there are a number of pain is the butt things you have to look out for... including the security authorization pop-up when you try to send mail via Outlook from another application and the restrictions around attachment types and the automatic stripping that can occur. If you have to deal with Outlook, there is a library called the "Outlook Redemption" library which makes it a breeze. I've used it before and it is by far the best way to deal with Outlook as the local mail agent. Especially if you have to send via Exchange because you don't have to setup a risky SMTP relay on the exchange server. The website is here: http://www.dimastr.com/redemption/home.htm[^] And best of all, you can send e-mail as the current user without their intervention... no need to 'pop' the message if you don't want to.