SQL Mail Problems!

  • My company recently outsourced out Exchange server. Now, we have problems with SQL Mail hanging from time to time. I read on Microsoft's site that accessing Exchange server across the internet is not recommended.

    Has anyone else experience this?

    Is there another way to get SQL Mail to work without MAPI?

     

    Thanks,

    Clif

  • Try xp_smtp_sendmail from http://www.sqldev.net

     

    --------------------
    Colt 45 - the original point and click interface

  • Thank you. I have already learned about SMTP Mail, and am aware of using it for DTS packages. What I reaaly need is a solution for Alerts, which are bound to MAPI mail.

     

    Clif

  • Alerts are not bound to MAPI mail, and if you're just using xp_smtp_sendmail in DTS then you're under utilising it. We use xp_smtp_sendmail for ALL emails that originate from SQL Server.

    Set up a scheduled job using xp_smtp_sendmail and SQL Agent Tokens (read more here, http://www.sqldev.net/sqlagent/SQLAgentStepTokens.htm#Example%20using%20TSQL%20step) then have your alerts execute the scheduled job.

    Here's the job step that we use, it calls another stored procedure to log the message in our own logging tables, but you can replace it by executing xp_smtp_sendmail with the appropriate parameters.

    DECLARE @vcrSubj varchar(100), @vcrMsg varchar(8000)
    SET @vcrSubj = 'Severity [A-SEV] Alert on [SRVR]'
    SET @vcrMsg = 'Code: [A-ERR]' + CHAR(10)
    SET @vcrMsg = @vcrMsg + 'Date: [STRTDT], Time: [STRTTM]' + CHAR(10)
    SET @vcrMsg = @vcrMsg + 'Database: [A-DBN]' + CHAR(10)
    SET @vcrMsg = @vcrMsg + 'Message: ' + REPLACE("[A-MSG]", '''','') + CHAR(10) + CHAR(10)
    SET @vcrMsg = @vcrMsg + 'Check the [SRVR] SQL Server Log and Application event log for details'
    EXEC DBA.dbo.usp_SendAlertMessage @vcrSubj, @vcrMsg

     

    --------------------
    Colt 45 - the original point and click interface

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

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