SendMail
This functions can send Email with an attach.
example:
declare @rtn int
select @rtn=dbo.SendMail('smpt','user','pass',port,EnableSsl,'from','to1,to2,toN','cc1,cc2,ccN','subject','body','c:\attach')
select @rtn
paramenters:
@smtp:
it's the smtp server
@user:
it's the user email
@pass:
it's the email pass
@port:
it's the port number of email
@EnableSsl:
boolean that enale(1) ssl or not(0)
@from:
it's the email that send message
@to:
email of who receive that email. could be concactened with ',' for multiple addresses
@cc:
email of who is in copy of email. could be concactened with ',' for multiple addresses
@subject:
it's the subject
@body:
it's the body
@attach:
it's the folder where the attach is could be concactened with ',' for multiple files