EXEC msdb.dbo.sp_send_dbmail  
    @profile_name = 'default',  
    @recipients = 'me@test.com',  
    @body = 'Test',  
    @subject = 'Test' ;  
EXEC msdb.dbo.sp_send_dbmail 
	@recipients= 'test@test.com',
	@profile_name = 'Default Profile',
	@subject = 'test',
	@body='test',
	@body_format = 'HTML';

Error:

Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2020-07-23T17:27:13). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.1 Unable to relay).
)

Fix:

Make sure the SQL Server Mail Account and Profile are setup correctly.

Last modified: March 2, 2021

Author

Comments

Write a Reply or Comment