I use sp_send_dbmail , which works fine except when I send to recipients using Gmail accounts. The database mail log gives the following error:
Error,80,The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2015-05-29T13:22:39). Exception Message: Cannot send mails to mail server. (Unable to send to a recipient.))
All non-Gmail recipients receive mail correctly.
When I use Outlook manually to send messages to these Gmail accounts, it works. Recipients correctly receive messages. SQL Server email account does not use Gmail. I use port 25 and SSL (I tried without SSL, and it doesn't work either).
The following is the procedure call:
EXEC msdb.dbo.sp_send_dbmail @recipients = ' somemail@company.com ; somemail@gmail.com ', @copy_recipients = ' somemail@company.com ', @profile_name = 'my_profile', @subject = 'mail subject', @body = 'some content', @body_format = 'Text';
source share