I'm tried to configure the database mail with Gmail SMTP Server, getting a message like:
The mail could not be sent to the recipients because of the mail
server failure. (Sending Mail using Account 4 (2019-01-11T14:46:42).
Exception Message: Cannot send mails to mail server. (Failure sending
mail.).
Can anyone give solutions for this
Your question is very general, but the first step is to create a profile and account using Configure Database Mail Wizard: In Object Explorer, go to Management > Database Mail and Create a new e-mail profile and specify its SMTP accounts.
Once that's done you can test by sending an email, like this:
USE msdb
GO
EXEC sp_send_dbmail #profile_name='ProfileName',
#recipients='test#Example.com',
#subject='Title email',
#body='This is the body of my email'
You should check your port and server adress to your mail. For example:
Port: 587
server: smtp.gmail.com
Remember, your SQL Agent should be enable.
Related
I have configured Gmail in SQL Server 2008, and it sends emails properly but after 6 Jun 2022 it does not send emails and shows email status failed with the following error:
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 7 (2022-08-03T09:05:17). 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.7.0 Authentication Required)
This is my configuration property
server name: smtp.gmail.com
port: 587
The server require secure connection : checked
Thanks in advance
Personal Gmail account doesn't allow connecting from "less secure apps" anymore.
Only from Google Workspace accounts (paid). In this case, you have to allow it in administration panel.
I think User Gmail Server Authentication needs to reauthorized
try to reconfigure SQL Server with Gmail.
I'm using SQL Server 2012 Developer edition to test Database Mail functionality. But I'm receiving the below error.
The steps I followed:
Installed e-mail certificate to Trusted root certification authorities.
Tested the e-mail functionality using sa user
Account 1 is using port 587 with SSL.
Account 2 is using port 465 with SSL.
Account 3 is using port 25 without SSL.
All accounts are with Basic authentication ( the user name and password is cross verified).
The mail could not be sent to the recipients because of the mail server failure.
(Sending Mail using Account 1 (2021-09-01T15:45:56). Exception Message: Cannot send mails to mail server. (The remote certificate is invalid according to the validation procedure.).
Sending Mail using Account 2 (2021-09-01T15:47:36). Exception Message: Cannot send mails to mail server. (The operation has timed out.).
Sending Mail using Account 3 (2021-09-01T15:47:57). Exception Message: Cannot send mails to mail server. (Service not available, closing transmission channel. The server response was: Cannot connect to SMTP server xxx.xx.xx.xx (xxx.xx.xx.xx:25), connect error 10060).
I'm try to send email with sql server ,for that purpose config with this way smtp:
Outgoing mail server(SMTP)
___________________________________ E-mail address:myEmail#gmail.com DisplayName:behzad ServerName:smtp.gmail.com PortNumber:587
Enable:This server requeires a secure connection (SSL)
____________________________________ SMTP Authentication - Basic Authentication UserName:myEmail#gmail.com Password:my Email Password
But when try to send simple mail get this error: The mail could
not be sent to the recipients because of the mail server failure.
(Sending Mail using Account 2 (2017-04-05T10:57:35). 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).
read any help on internet and enable two step verification gmail and...
but so get that error.How can i solve that problem?thanks.
I have a SMTP server by using which I was smoothly sending e-mails using sp db_mail.But now I am not able to send any DB mail using the same profile, all the configuration from SQL Server is fine, but instead getting the following message in Error log
Message
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2016-04-21T04:09:58). Exception Message: Cannot send mails to mail server. (Failure sending mail.).
)
P.S. By using the same SMTP server, I am able to send Mails from another IP.
The telnet thing is getting aborted when I tried it from the command line.
Any ideas?
I know how to send mail using an SMTP server specified in a mail profiler in the Database Mail of Sql Server.
You would do it like so:
EXEC msdb.dbo.sp_send_dbmail #profile_name = 'profile',
#recipients = #email,
#body = #body,
#body_format = 'HTML',
#subject = #subject
But I don't know how to send mail using Microsoft Exchange.
Update 1.
I believe that the main problem of my not being able to send mail through Exchange is that it's using the NTLM-based authentication. And I most certainly don't want my Sql Server running using my domain user credentials.
Update 2.
Thank you for your suggestions. Here's the catch. I don't have any control whatsoever over the corporate Exchange Server in question. So the only course of action would be to try to impersonate me on the Exchange endpoint somehow. Luckily, I can communicate with the Exchange via telnet ip-of-the-exchange-server 25.
Use your Exchange Server's IP as the STMP server in SQL Server and
configure Exchange Server's SMTP connector to allow relaying for the IP of your SQL Server.
Follow the link for instructions on how to do this with Exchange Server 2003 and 2007.
Regarding your Update: If you do it like described above (allow relaying), you don't need any credentials. Every process on your SQL Server's machine will be allowed to send mail through your Exchange Server, without any authorization.
Here are some general hints to debug an SMTP connection. To test this configuration, you could open a command line on your SQL Server and use telnet to create an SMTP session (you have to type the lines that do not begin with a number):
C:\>telnet ip-of-your-exchange-server 25
220 your.domain Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Thu, 2 Sep 2010 16:19:33 +0200
EHLO heinzi
250-your.domain Hello [192.168.3.1]
250-TURN
[...]
250-XEXCH50
250 OK
MAIL FROM:<your#email.address>
250 2.1.0 your#email.address....Sender OK
RCPT TO:<some.other.address#outside.your.domain>
After the last line, your receive either of two answers. This one means that everything is fine:
250 2.1.5 some.other.address#outside.your.domain
This one (or a similar one) means that you have still not configured your Exchange Server correctly:
554 5.7.1 <some.other.address#outside.your.domain>: Relay access denied
Exchange is just another SMTP server. You point your profile to the specifics of your server, and you're done. I do it every day in my environment. Is SMTP disabled for some reason on your Exchange instance?