xp_sendmail issue

  • I have configured SQL mail to send emials, both by using DTS Mail Task as well as calling xp_sendmail within my procedures. It is SQL 2000 with exchange 2003 mailbox account.

    all DTS mail tasks are successfully sending mails, while xp_sendmail is generating the following error.

    18025 level 16 state 1 line 0 xp_sendmail failed with mail error 0x80004005

    I checked on microsoft support http://support.microsoft.com/default.aspx/kb/293422, but it is about exchange 2000.

    First of all I want to know if DTS Mail task is using a different way of sending the mails than xp_sendmail. if they are the same then why do I get the above error. either both should stop or both should work.

  • SQL Mail requires that Outlook be installed and configured on the server to send mail. A mail profile must be setup with connection information to your Exchange server.

    xp_sendmail does not require Outlook to be installed. I believe that it uses CDO to send the email. You must specify a valid SMTP server to send the email.

    ------ correction ----------------------------

    (xp_sendmail uses SQL Mail and requires a MAPI profile for the SQLSERVER service user) xp_smtp uses CDO to send via an SMTP server http://www.sqldev.net/xp/xpsmtp.htm

    ---------------------------------------------

    Since SQL Mail is sending to Exchange directly through Outlook, it is not using SMTP. It is likely that your Exchange server is setup to only accept SMTP relays from certain IP addresses. Your SQL box may not be included in that list.

    Hope that helps a little.

  • Actually, SQL Mail on SQL Server 2000 requires a MAPI client be installed on the server (Outlook, not Outlook Express). xp_sendmail uses MAPI to send mail. I don't know about the DTS Send MAIL task, never used it in SQL Server 2000 DTS packages, but I used xp_sendmail in numerous stored procedures in SQL Server 2000 at my last employer to send short reports, or status emails regarding processing errors.

    😎

  • Sorry... I got xp_sendmail mixed up with xpsmtp (http://www.sqldev.net/xp/xpsmtp.htm). I use xpsmtp because you do not need a mapi client installed on the SQL Box. Much cleaner and it works great.

    DTS Send Mail Task uses SQL Mail, as does xp_sendmail. So, in that regard, they should both be working in the same manner.

    Are you running the DTS package interactively? If so, then your username is being used to authenticate and run SQL Mail. When you execute xp_sendmail, it is authenticating as the SQLSERVER Service user. This is one of the big problems with SQL Mail. That user defined for the service would need to have a MAPI profile created in Outlook.

    You may want to consider xpsmtp instead of xp_sendmail. Otherwise, you will have to log onto the server as the service user and configure the MAPI client.

Viewing 4 posts - 1 through 3 (of 3 total)

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