February 20, 2012 at 1:35 pm
Actually, I wrote an enhanced version that allows for dynamic SMTP servers as well as logging to a SQL table. I'll update the article or send in a new one; should be able to have it out within the next week or so.
February 20, 2012 at 1:53 pm
Therefore, users who are authenticated with SQL Server Authentication cannot attach files using @file_attachments. Windows does not allow SQL Server to provide credentials from a remote computer to another remote computer
I donβt think it is related because @file_attachment is local variable in SQL Server not related to system.net used for Microsoft SMTP mail. Please check the link below for the system stored procedure that defines attachment file size and related issues, the reason you can use Default for the connection properties but you still need to talk to system admin and Exchange admin.
http://msdn.microsoft.com/en-us/library/ms191442.aspx
Kind regards,
Gift Peddie
July 18, 2012 at 5:30 am
Brilliantly simple stuff, many thanks!
This solved an age-old problem for us, and we are highly indebted to people like you that take the time to share your knowledge.
Once again, thanks! π
July 12, 2013 at 1:08 am
Thanks
July 12, 2013 at 9:19 am
<begin>
Dim strRecip As String
Dim strTo() As String = recipients.Split(";")
For Each strRecip In strTo
MailMsg.To.Add(New MailAddress(strRecip))
Next
Instead of looping thru the array have you considered something like String.Join(",", strTo) ?
This allows you to let MS manage the looping and also inserts the comma between names. Since you Split(";") I wonder if it might be easier/quicker to recipients.Replace(";", ",") and thus no need for the array to begin with and you now have a comma separated list that the Address collection is looking for?
Cool function and thanks for a good demo of making a clr function for SQL Server.
July 12, 2013 at 2:51 pm
Passing in a comma separated list of recipients is good and well if you were hard-coding them, but it would become more work if it were queried from a table. I'd imagine that you could pass in a table variable to be consumed as a DataTable instead. I've done this with a C# app., but not with an extended stored procedure.
July 12, 2013 at 3:20 pm
Great article, but I don't understand why you would go thru all this trouble, not to mention opening up CLR on the server, which is a security risk if not handled correctly, when all you need to do is execute sp_send_dbmail (just like on a regular standard or enterprise install of SQL)?
July 14, 2013 at 2:55 pm
Nice solution - just wondering why you wouldn't simply use DBMail?
July 16, 2013 at 3:17 am
Nice to read.......
thinking in a new way π
March 28, 2017 at 9:23 pm
Excellent stuff. I have managed to get it working on a new SQL Express 2016 server.
Viewing 10 posts - 46 through 54 (of 54 total)
You must be logged in to reply to this topic. Login to reply