April 19, 2019 at 11:50 am
Hi All
I am setup mail configuration in sql server database but it is not send and return error. like below is error message.
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 9 (2019-04-19T10:43:22). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at). )
Can you Please send some sample code .
Regards
Pols
April 19, 2019 at 12:16 pm
This doesn't sound like you need sample code but that the email server you're connecting to isn't allowing you to send emails. You probably need to talk to the administrator that is responsible for that server.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
April 19, 2019 at 12:24 pm
This was removed by the editor as SPAM
April 19, 2019 at 12:24 pm
Make sure the mail server is configured to allow the SQL server to relay messages. Also make sure you have set up the correct credentials for the database mail configuration. This last could be the cause of the "Authentication Required" error.
April 19, 2019 at 12:25 pm
i am using my personal mailid like my code is
--Creating a Profile
EXECUTE msdb.dbo.sysmail_add_profile_sp
@profile_name = 'SQLProfile',
@description = 'Mail Service for SQL Server';
-- Create a Mail account for gmail. We have to use our company mail account.
EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = 'SQL_Email_Account',
@email_address = 'xxxx@gmail.com',
@mailserver_name = 'smtp.gmail.com',
@port=587,
@enable_ssl=1,
@username='xxxx@gmail.com',
@password='xxxx'
-- Adding the account to the profile
EXECUTE msdb.dbo.sysmail_add_profileaccount_sp
@profile_name = 'SQLProfile',
@account_name = 'SQL_Email_Account',
@sequence_number =1 ;
-- Granting access to the profile to the DatabaseMailUserRole of MSDB
EXECUTE msdb.dbo.sysmail_add_principalprofile_sp
@profile_name = 'SQLProfile',
@principal_id = 0,
@is_default = 1 ;
April 19, 2019 at 12:52 pm
Try enabling the less secure apps setting. Refer to the following which addresses the same error with gmail:
Sue
April 19, 2019 at 1:17 pm
Allow less secure apps ON but it is not working...error message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 9 (2019-04-19T14:14:51). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at). )
April 19, 2019 at 1:47 pm
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 16 (2019-04-19T14:45:36). Exception Message: Cannot send mails to mail server. (Failure sending mail.). )
April 19, 2019 at 2:31 pm
There are other settings in gmail that can affect this. Other things to try such as Disable two factor authentication, disable unlock captcha, log into gmail while on the server where you are setting this up. Essentially You need to mess with things on the gmail side.
Sue
April 19, 2019 at 2:57 pm
Still Not Working...
April 19, 2019 at 6:20 pm
It's not a SQL Server issue. Check the google forums for smtp with gmail - that's what I did when setting up something at home to use gmail.
Sue
April 19, 2019 at 7:31 pm
Didn't Lowell Aguirre post something on using gmail for this? I think it was several years ago, but should still be applicable.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply