I have executed the following.
EXEC msdb.dbo.sp_send_dbmail @profile_name='Client_Messages',
@from_address= 'Client Automation <[email protected]>',
@recipients='[email protected]',
@subject='This is a Test mail',
@body='This is a Test mail from Test DB server',@body_format='html';
Getting error. some times it worked ,ie; mail executed successfully. sometime error occurred. The error message is given below.
Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 6 (2021-10-23T17:26:05). Exception Message: Could not connect to mail server. (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 12.18.126.228:587).