Send Email with HTTP File attachment

This activity allows sending emails with attachments retrieved using a web request . Executing Reporting Services report and sending it as an attachment from within SPD workflow would be one such example. Request url is fully customizable and can include workflow variables. Both http and https requests are supported.

Last edited Jul 6, 2007 at 4:07 AM by unclepaul84, version 8


bruno2007 Feb 26, 2014 at 9:23 AM 
These activities are not working in secure environments (https://). the workflow gives "Failed on Start"

Loopdreams Sep 6, 2011 at 3:25 PM 
First of all thanks for these actions. I'm having one problem with this one though. Trying to attach a PDF file it fails with:

System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: The connection was closed.
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.

It'll send files with any other extension with no problem at all, it even send the PDF file if the file extension is changed. Been tearing my hair out over this as this is the final stage of a solution which otherwise works really well. Any help from anyone much appreciated.

savy_2010 Mar 9, 2011 at 5:53 PM 
I am using SP2010 designer. Can this activity be deployed to SP 2010 or is it only for SP2007? Thanks!

cray4 Feb 24, 2011 at 7:34 PM 
When using this, I can get it to successfully send a .txt file. However, when I try it on an Infopath .xml file it has a problem similar to other people in that it doesn't associate the file with any program, and has "garbage" in it. I have: Send -non urgent- email, display as sender. Also attach file named [%Library:Name%] (it uses name for use in forms) retrieved from this url: [%Library:Encoded Absolute URL%]. -Do not impersonate-... Runing the workflow manually on a .txt works perfect and the file is just as it should be, but it's when I try it on the Infopath .xml that it comes across with a default icon and garbage inside. The filename is correct, with extension, but it's as if it's having issues with xml?

ammaryasir Nov 30, 2010 at 5:20 AM 
I am applying the same action here. But getting garbage values when the attachment opens up at user end. Is there any kind of service pack that can help me get rid of this issue? (I have already installed SPD service pack 2).
Also should I re-install these custom actions?

edgarley Nov 29, 2010 at 8:43 PM 

This is what the action for my wf looks like:

"Send non Urgent email to list:email, display as sender.Also attach file named customform.pdf retrieved from this url: http://sharepoint/site/documentlibrary/customform.pdf Do not impersonate sharepoint account when getting the file"

The extension and file name is assigned in field that comes after "Also attach file named".... a string builder window pop ups up, there you type the name of the file and extension as you want it to be emailed.

ammaryasir Nov 26, 2010 at 4:46 AM 
Can you guide me for reference on how you are assigning file extension to the file, using this wflow?

ammaryasir Nov 26, 2010 at 4:35 AM 
I am also adding the extension type in the workflow ("file name attached field") but not getting the desired results. The reason I am saying that its associating a garbage value to the attached file is; that the file size of the attached file increases after the action is performed
Similarly if I attach an empty notepad file, the workflow add codes in its empty. Hence its adding garbage to its content.

edgarley Nov 24, 2010 at 8:37 PM 
Hi Ammaryasir.. I had a similar problem having files attached whit what it seem to be garbage also no program was associated whit the attached file, in my case the problem was that i wasen't typing the file extencion in the file name field, once i added the .pdf extension the file appear correctly in the sent emails.

hope that this helps

ammaryasir Nov 22, 2010 at 5:09 AM 
I'm having an issue with a customized workflow when I send an email with an attachment. I am using the "send email with http file attachment" that I have downloaded from CodePlex. Unfortunately all attachments that come through are full of garbage. This includes .jpg, .pdf, and .txt. From what I can tell with the .txt file is that its contents has been replaced with what appears to be the html of the list page. Both the .jpg and .pdf fail to open complaining about corrupt documents. All documents can be opened fine from within sharepoint.

What should I do to solve this problem?

frenchman29 Jan 28, 2010 at 4:15 AM 
when I try to install the Sharepoint Designer Custom workflows it does a check to see if it can be installed from this machine, but when it completes the check the only thing that doesn't check out is one thing --> the error" the windows sharepoint services administration is not yet started" I have opened my WSS admin, so could someone tell me exactly what you must config or change in order to get this to install or how did you all do this???.thanks in advance

bernulli Jan 20, 2010 at 8:50 PM 
I also had nothing happen when selecting a custom workflow on one machine. After a day of frustration I found the issue. You need to install SP1 for SharePoint Designer 2007. With SP1 installed everything works as designed.

MikeSam Jul 2, 2009 at 7:18 PM 
Update. Found my issue. Needed to select "Name (for use in forms)” and not just the file "Name".

MikeSam Jun 26, 2009 at 1:19 PM 
Has anyone seen the issue where the attachment arrives in the email however it does not have an extension and there is no default program associated? The name appears as the attachment in email such as when test.doc is posted to a library only the attachment name of "test" is in the email as a file. I can save it as test.doc and the file has all the contents when i open it from the desktop. Any ideas? The string builder is using "current item" and "[%DocumentLibrary:Name%]. Thanks

tombryan Mar 12, 2009 at 5:41 PM 
Found it. Right there in the install guide. You have to copy the ACTIONS file to the other language site in the layouts/your other language/workflows folder. IISRESET and it works.

tombryan Mar 12, 2009 at 5:24 PM 
Activities work great for me. Is there a way to allow these activities to be available for a site created with the language pack? I have a site created using the Spanish language pack and the useful workflow activities do not show in SPD. Any thoughts?

BajanCyberdude Feb 21, 2009 at 12:45 AM 
I installed these actions but when I try to create a workflow and select the new custom actions, nothing happens. I do not get prompted for any parameters! Am I missing some setting from the Central Administration? I have Activated it. Thanks for any help offered.

stevesobo Feb 11, 2009 at 7:41 PM 
Works great. But I'm having one issue with the file extensions. my smtp server is working fine but the attachment has been removed from each file that I send. Is there an association that I'm missing? I use the variables in the body of the email to confirm I'm supplying the correct information.

bfrichey Feb 7, 2009 at 9:50 PM 
This is not working for me. It sends the email supposedly with the attachment, but the attachment is more like a dummy if it were never able to grab the file. Any ideas why this is happening?

mohan_datt Aug 5, 2008 at 6:55 PM 
I tried Send email Extended activity feature but it is not working for me.

unclepaul84 Feb 26, 2008 at 9:52 PM 
see Send Email Extended activity

merwinb Jan 3, 2008 at 2:38 PM 
Hey - this is a WONDERFUL set of custom actions however I'm having a bit of trouble in the way I am trying to use this function in particular. I don't need to send http attachments but I DO need to specify the sender's address (because it is different from the system default). When I attempt to use this custom action without entering an attachment I recieve an error in the workflow. Any advice on using this action to send email with a specific FROM address without using the other options?