July 7, 2009 at 4:27 am
I would like to email a an entire content of a folder.
We have a client placing files on our FTP site, but they do not know how many files they might place in this folder.
Can this be done?
Thanks
July 7, 2009 at 7:32 am
Any ideas please? this is failry urgent
July 8, 2009 at 9:40 am
I assume you're talking about using sp_send_mail.
I think you can zip-it and then just send the one zipped file.
July 8, 2009 at 3:05 pm
I think "sp_Send_dbmail" might hep you. Attach all the files in the sp_send_Dbmail. Here is the syntax just incasesp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
[ , [ @recipients = ] 'recipients [ ; ...n ]' ]
[ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ @subject = ] 'subject' ]
[ , [ @body = ] 'body' ]
[ , [ @body_format = ] 'body_format' ]
[ , [ @importance = ] 'importance' ]
[ , [ @sensitivity = ] 'sensitivity' ]
[ , [ @file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ @query = ] 'query' ]
[ , [ @execute_query_database = ] 'execute_query_database' ]
[ , [ @attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ @query_attachment_filename = ] query_attachment_filename ]
[ , [ @query_result_header = ] query_result_header ]
[ , [ @query_result_width = ] query_result_width ]
[ , [ @query_result_separator = ] 'query_result_separator' ]
[ , [ @exclude_query_output = ] exclude_query_output ]
[ , [ @append_query_error = ] append_query_error ]
[ , [ @query_no_truncate = ] query_no_truncate ]
[ , [ @mailitem_id = ] mailitem_id ] [ OUTPUT ]
But If u have a Sql server auth, the attachment will fail. I had these issue.
I think steps to consider are ---
1. get a for each loop. (declare varibale to hold FullFilePathNameAndExt)
2. get back each file name with full filepath and extension.
3. (you will also have to declare a variable say Attach to hold all files path and name with extensions, seperated by ;).
4. inside foreach loop write script task that will update ur variable Attach each time so that to holds all the file name and path, something like
5. get the execute sql task and in the expression build the Sp_send_dbmail proc to execute and in the attachemnts , subsiture with the variable that holds all the filename and path.
hope this works
July 8, 2009 at 3:05 pm
I think "sp_Send_dbmail" might hep you. Attach all the files in the sp_send_Dbmail. Here is the syntax just incasesp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
[ , [ @recipients = ] 'recipients [ ; ...n ]' ]
[ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ @subject = ] 'subject' ]
[ , [ @body = ] 'body' ]
[ , [ @body_format = ] 'body_format' ]
[ , [ @importance = ] 'importance' ]
[ , [ @sensitivity = ] 'sensitivity' ]
[ , [ @file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ @query = ] 'query' ]
[ , [ @execute_query_database = ] 'execute_query_database' ]
[ , [ @attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ @query_attachment_filename = ] query_attachment_filename ]
[ , [ @query_result_header = ] query_result_header ]
[ , [ @query_result_width = ] query_result_width ]
[ , [ @query_result_separator = ] 'query_result_separator' ]
[ , [ @exclude_query_output = ] exclude_query_output ]
[ , [ @append_query_error = ] append_query_error ]
[ , [ @query_no_truncate = ] query_no_truncate ]
[ , [ @mailitem_id = ] mailitem_id ] [ OUTPUT ]
But If u have a Sql server auth, the attachment will fail. I had these issue.
I think steps to consider are ---
1. get a for each loop. (declare varibale to hold FullFilePathNameAndExt)
2. get back each file name with full filepath and extension.
3. (you will also have to declare a variable say Attach to hold all files path and name with extensions, seperated by ;).
4. inside foreach loop write script task that will update ur variable Attach each time so that to holds all the file name and path, something like
5. get the execute sql task and in the expression build the Sp_send_dbmail proc to execute and in the attachemnts , subsiture with the variable that holds all the filename and path.
hope this works
July 8, 2009 at 3:05 pm
I think "sp_Send_dbmail" might hep you. Attach all the files in the sp_send_Dbmail. Here is the syntax just incasesp_send_dbmail [ [ @profile_name = ] 'profile_name' ]
[ , [ @recipients = ] 'recipients [ ; ...n ]' ]
[ , [ @copy_recipients = ] 'copy_recipient [ ; ...n ]' ]
[ , [ @blind_copy_recipients = ] 'blind_copy_recipient [ ; ...n ]' ]
[ , [ @subject = ] 'subject' ]
[ , [ @body = ] 'body' ]
[ , [ @body_format = ] 'body_format' ]
[ , [ @importance = ] 'importance' ]
[ , [ @sensitivity = ] 'sensitivity' ]
[ , [ @file_attachments = ] 'attachment [ ; ...n ]' ]
[ , [ @query = ] 'query' ]
[ , [ @execute_query_database = ] 'execute_query_database' ]
[ , [ @attach_query_result_as_file = ] attach_query_result_as_file ]
[ , [ @query_attachment_filename = ] query_attachment_filename ]
[ , [ @query_result_header = ] query_result_header ]
[ , [ @query_result_width = ] query_result_width ]
[ , [ @query_result_separator = ] 'query_result_separator' ]
[ , [ @exclude_query_output = ] exclude_query_output ]
[ , [ @append_query_error = ] append_query_error ]
[ , [ @query_no_truncate = ] query_no_truncate ]
[ , [ @mailitem_id = ] mailitem_id ] [ OUTPUT ]
But If u have a Sql server auth, the attachment will fail. I had these issue.
I think steps to consider are ---
1. get a for each loop. (declare varibale to hold FullFilePathNameAndExt)
2. get back each file name with full filepath and extension.
3. (you will also have to declare a variable say Attach to hold all files path and name with extensions, seperated by ;).
4. inside foreach loop write script task that will update ur variable Attach each time so that to holds all the file name and path, something like
5. get the execute sql task and in the expression build the Sp_send_dbmail proc to execute and in the attachemnts , subsiture with the variable that holds all the filename and path.
hope this works
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply