Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: SQL Mail not functioning

    I'm attempting to get SQL Mail configured so I can use xp_sendmail to send out database query results automatically.

    We're doing this via 2 accounts, 1 account (call it sql) calls the MSSQL procedures. Another account(sqlmail) handles all the mailing. In the SQL Mail account screen, the outlook profile config'd does test OK, and mail can be sent and rec'd through outlook. When xp_sendmail is called, it returns the following error:

    Server: Msg 18025, Level 16, State 1, Line 0
    xp_sendmail: failed with mail error 0x80004005

    I'm running SQL Server 2000 SP3, and Exchange Server 2000.

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    try using xp_smtp_sendmail instead, unless you're planning to receive and process mail as well.

  3. #3
    Join Date
    Oct 2003
    Posts
    3
    Originally posted by ms_sql_dba
    try using xp_smtp_sendmail instead, unless you're planning to receive and process mail as well.
    I found a link to that procedure...however, i couldnt find any way for it to automatically attach the results of a query it runs. Would you recommend just using a different command line query function and then using that for the mailing? Or can anyone think of a different way to either a.) get xp_sendmail to work or b.) do the same thing (run a query then attach the results in CSV format to an email.
    Last edited by ChloroFiend; 10-08-03 at 16:15.

  4. #4
    Join Date
    Sep 2003
    Posts
    522
    try @messagefile='c:\tmp\query_output.rpt'

  5. #5
    Join Date
    Oct 2003
    Location
    Suzhou, China
    Posts
    4
    Please confirm you start
    SQL Server service and SQL Executive server with the account
    can access the email.
    If start with system account, the SQL mail can NOT use.

  6. #6
    Join Date
    Oct 2003
    Posts
    3
    Originally posted by royxiao
    Please confirm you start
    SQL Server service and SQL Executive server with the account
    can access the email.
    If start with system account, the SQL mail can NOT use.
    The SQL services are started with the SQL account, which has send/receive/use rights to the SQLMail account. While logged in using the SQL login, mail can be sent and rec'd via outlook(the profile set to be used for SQL Mail) using the SQLMail account.

  7. #7
    Join Date
    Jan 2004
    Posts
    1

    Talking Server: Msg 18025, Level 16, State 1, Line 0 xp_sendmail: failed with mail error 0x80

    to fix the send email problem ensure that you are running SQL 2000 SP3
    the run the following query

    exec XP_Stopmail

    exec XP_Startmail

    exec xp_sendmail
    @recipients = 'xyz@yourdomain.com',
    @message = 'Test',
    @subject = 'test of sendmail'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •