I am using sp_send_dbmail
which is working perfectly except when I send to recipients using Gmail accounts. The database mail log give 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 recipients not using Gmail receive the mail correctly.
When I use Outlook manually to send messages to this Gmail accounts it is working. The recipients receive the messages correctly. The SQL Server mail account is not using Gmail. I use Port 25 and SSL (I tried without SSL and it is not working either).
Here below the procedure call:
EXEC msdb.dbo.sp_send_dbmail
@recipients = '[email protected];[email protected]',
@copy_recipients = '[email protected]',
@profile_name = 'my_profile',
@subject = 'mail subject',
@body = 'some content',
@body_format = 'Text';
I tested the sp_send_dbmail proc in SSMS and it works fine for gmail. On the message panel, I got message 'Mail queued'.
You may trouble shoot the queue using:
msdb..sysmail_help_queue_sp @queue_type = 'Mail' ;
for me, it look like smtp mail relay issue. You should also test you DB mail profile setup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With