Issues in Database mail

  • Hi,

    I have one issue in database mail which I posted before but did not get proper answer.

    I have configured database mail in SQL server 2005. When sending the test mail, I am getting the error as below as per the log file

    "The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 2 (2009-05-27T09:22:39). Exception Message: Cannot send mails to mail server. (Command not implemented. The server response was: Error: command not implemented)"

    When running the script,

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'AdventureWorks Administrator',

    @recipients = 'danw@Adventure-Works.com',

    @body = 'The stored procedure finished successfully.',

    @subject = 'Automated Success Message'

    It is showing as Mail queued. But not getting delivered.

    Is it due to some problem in connecting to SMTP sever?

    Can it be an access issue?

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • Do you have the profile/account created .above all do you have outlook on your machine ..

    If not it will not work .

    You need to be able to access your exchange server form your machine ..

    Abhay Chaudhary
    Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)

  • I think its because of SMTP server.

    Do you having outlook.

    Check these too:

    1.Have u given the correct IP and port for SMTP.

    2.In database mail profile (ie. AdventureWorks Administrator) did u add the correct account (probably sumantr@Adventure-Works.com ) to be used for sending the mail try also add alternative account too.

    3.In sql server agent -> properties->alert system->

    -check enable mail profile (ie. AdventureWorks Administrator)

    -Mail system as Database Mail

    -Mail profile as profile that you have mentioned in the script.

    4.Use these to verify your mails

    Use msdb

    select * from sysmail_mailitems

    select * from sysmail_log

    select * from sysmail_sentitems

    5.Also try sending a test mail to danw@Adventure-Works.com .

    Tanx 😀

  • Hi,

    Thanks for the reply.

    I have checked the above steps as you mentioned.

    I am able to send message through SMTP commands but not through SQL mail. So I think no problems in SMTP settings.

    Can you plaese let me know what else needs to be checked?

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • Have you made sure the port (25?) is open and available? You could run a telnet session to check...

  • In SMTP allow anonymous access/relay.

    Alex S
  • Just to clarify, you do NOT need Outlook installed on your SQL Server to use Database Mail.

    What is the SMTP server you are using?

  • Hi,

    I ran telnet session from that server and I am able to deliver the message through command prompt. I think the error I am getting which is "command not implemented" is due to the wrong command in SMTP and the error no is 502. Is there settings required between SQL server and SMTP server?

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • Yes. As the poster above mentioned, you must create a profile in SQL Server (that has SMTP server name, port, authentication etc).

  • This is a good read for setup:

    http://www.mssqltips.com/tip.asp?tip=1438

    Easy to follow...

  • Hi,

    I have created SMTP priflle with valid data but still I am facing the same problem. Is there any software or settings in IIS or some other things are required?

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • If you have an anti-virus installed, check the settings to make sure it's not blocking the application. You may need to add exceptions.

    databasemail90.exe

    DTExec.exe (SSIS)

    dtexecui.exe

    You should be able to see this "blocking", or "denied" in the various AV logs.

    If you haven't "restart" the SQLServerAgent, after you add the profile to the SQLServerAgent--Alert System.

  • Are you able to send mail from any programing language application (eg, from ASP, or C#) with your setting which you used here?

    "Don't limit your challenges, challenge your limits"

  • I am able to send the message from that server through telnet command by SMTP server.

    With the same smtp server I am able to send mail from another server. I am facing the problem in two server which I tried to configure mirroring but failed. Is there any dependency between database mail and mirroring?

    Ryan
    //All our dreams can come true, if we have the courage to pursue them//

  • One of following solution can resolve your problem.

    1. Add port 25 to firewall port exceptions.

    2. Verify mail account authentication specially SSL.

    3. Check antivirus program or disable it, restart SQL Services.

    4. Try.

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic. Login to reply