SQL Mail not working

  • Hello,

    I'm having a SQL 2000 box (SP4) with mail profile configured on the server, but no mail is being sent for any job when it fails. I have created an operator and could send the test mail to self without any problem but it is not working as part of the notifications from the job. The error message it is giving out is as follows:

    Executed as user: domain\login. xp_sendmail: failed with mail error 0x80040111 [SQLSTATE 42000] (Error 18025).  The step failed.

    Not able to figure out the root cause for the problem.

    Appreciate any suggestions.

    Thanks


    Lucky

  • Is the SQL Agent set to startup using a domain account? IF you so you need to logon to SQL Server with that account and configure "OUTLOOK" profile. xp_sendmail uses the profile set up fot the account that SQL  Server starts with and Job Failure Notifications is based on the account that runs SQL Agent.

    Hope this helps.

    Thanks

    Sreejith

  • Google "xp_smtp_sendmail".  Its an extended stored procedure that uses SMTP for mailing from SQL Server.  Its a beautiful thing.  You'll never need a MAPI client on your SQL Server again.  There is a SQL 7.0 and 8.0 version and comes with installation instructions.  I use it all over the place and never have a problem.

  • check the Email profile if some thing as changed & also coordinate with Exchange Admin to make sure that nothing as changed from there ends.

     

    Thanks

  • Try a test by leaving the Outlook MAPI client open and minimized on your SQL Server box, then do a notificaiton test.


    Kindest Regards,

    (Anonymous) SQL Server DBA

  • sqlmail is the most evil thing that exists and i cannot wait until we go to sql2005. i don't care about all the gee whiz things in it except that there is no more sqlmail.

    install outlook 2000 on your sql server. set up profile and open the mailbox via outlook. type in profile name in support services > sql mail. default is MS Exchange Settings or you can look in the mail icon in the control panel. restart SQL Server service or reboot your server. it should work.

    • Ensure MSSQLSERVER and SQLSERVERAGENT services log on using the same account ("Domain\User")
    • Install MS Outlook
    • Log on to PC as "Domain\User"
    • Open Outlook and Configure exchange settings
    • Open Enterprise Manager and right-click on SQL Server Agent. Select Mail Profile "MS Exchange Settings" (after restarting SQL Server Agent)

     

    • The last post by blade is exactly what you need to do if you're using Outlook.

      Or try SMTP mail.  Job Step 1 executes whatever.  On success it quits reporting success.  On failure, it goes to step 2 which sends you an email telling you your job failed.  All my jobs do this and I have no Outlook, no MS Office update/upgrade reboots and no 'job completed but didn't send mail' mysteries.  I'm telling you, xp_smtp_sendmail is the DBA's best friend.

    • Randy,

      Do you know how to send to multiple people? I've also e-mailed Gert to see if I can get some help. I've tried the usual separtors (, and . It runs fine be the email doesn't go through. It doe work with one email address.


      Terry

    • The semi colon ( is used to delimit email addresses within the @to parameter in xp_smtp_sendmail.

      This is cut from a SP I use, names changed to protect the innocent...

      exec master.dbo.xp_smtp_sendmail

       @from = 'sqladmin@myplace.org',

       @to = 'randy@myplace.org;

       mary@myplace.org;

       dave@myplace.org;

       joe@myplace.org;

       sam@myplace.org;

       mike@myplace.org',

       @server = 'exchange_server_name.myplace.org',

       @subject = 'Data Pool Compile',

       @message = 'The Financial Data Pool has been compiled.'

    • Weird. I can't seem to get it to work in the "To:" line but I can in the "CC:". I'll keep trying. Thanks.


      Terry

    Viewing 11 posts - 1 through 10 (of 10 total)

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