1

I have no permission to execute sp_send_dbmail in server and no admin permission to configure that. So, I need an alternative solution. Maybe a script similar to sp_send_dbmail that could be scheduled in the server, sending emails with the query result.

I'm not used with Windows, tried to find something in the web, but without success. Someone have a tutorial, suggestion or a document where I can find the solutio to my problem?

Italo Borssatto
  • 15,044
  • 7
  • 62
  • 88

1 Answers1

0

Maybe a script similar to sp_send_dbmail that could be scheduled in the server, sending emails with the query result

It is not possible,also sp_send_dbmail doesn't require admin permissions..so it is better to request permissions

Execute permissions for sp_send_dbmail default to all members of the DatabaseMailUser database role in the msdb database.

You could use different mail servers,but if you want to send email using SQLSever,only way is to use database email..

you could also use C# if you can ,but sending results is little hard

using System.Net.Mail;

...

MailMessage mail = new MailMessage("you@yourcompany.com", "user@hotmail.com");
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.outlook.com";
mail.Subject = "this is a test email.";
mail.Body = "this is my test email body";
client.Send(mail);
TheGameiswar
  • 27,855
  • 8
  • 56
  • 94