Problems with sp_send_dbmail in SQL Server 2005

1740 pts.
Tags:
Sendmail
SQL Server 2005
Stored Procedures
I am trying to convert my stored procedures in SQL 2005 from using xp_smtp_sendmail to using sp_send_dbmail. When I use the "Send Test Email" option in the management studio, I am getting the following error message from the sp_send_dbmail: The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 5 (2008-01-08T13:12:46). Exception Message: Cannot send mails to mail server. (Syntax error in parameters or arguments. The server response was: Unknown command).) It is using the same server and the same email addresses etc. that works with xp_smtp_sendmail. The account is set up as anonymous authentication. Does anyone know what my problem could be or what I should look for to correct this?

Answer Wiki

Thanks. We'll let you know when a new response is added.

What options do you have setup in the database mail config?

What SMTP server are you using?

It sounds to be like you setup authentication or something in database mail, but the mail server doesn’t support authentication.

I had a problem where virus software has a policy blocking port 25 for SMTP servers.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    Check out my SQL Server blog "SQL Server with Mr Denny" for more SQL Server information.
    66,290 pointsBadges:
    report
  • Randym
    The options I have set are port 25 using anonymous authentication for this smtp server. We are using different smtp servers based on the customer we are sending for and the xp_smtp_sendmail works for all the servers the way they are set up but only 2 of the 4 work with sp_send_dbmail. Below is the log from the smtp server with the first being an email sent with xp_smtp_sendmail and the second sent with sp_send_dbmail. 02:59:40.80 2 SMTPI-94066([xxx.xxx.xxx.xxx]) [73605440] received, 965 bytes 08:37:20.94 3 SMTPI-20562([xxx.xxx.xxx.xxx]) read failed. Error Code=connection closed by peer Thanks for your help Mrdenny
    1,740 pointsBadges:
    report
  • Denny Cherry
    That message indicates that the database closed the connection for some reason. What is in the database mail log? What kind of SMTP server is working, and what kind of SMTP server isn't working. Why not setting up a local SMTP server and send all email to that then will send the emails on to the final destination.
    66,290 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following