receive emails from SQL Server 2000

  • Is it possible to receive emails from SQL Server 2000?

  • Yes.  You would use SQL Mail.  This requires a mapi client to be installed on the server (Outlook, not Outlook Express).

  • Hi lynn,

    Thanks for information.

  • I know there is two places to set it. There is SQL Mail and also for the SQL Server Agent. If you're looking to receive mails from jobs that your are running, don't forget to set the SQL Server Agent as well. Rigth click on "SQL Server Agent" and go to properties. Then set it in there.

    Correct me if I'm wrong, but I believe you setup SQL Mail just so you can call it from queries or stored procedures.

  • Try this link. It works great with DTS packages.

    http://sqldev.net/DTS/SMTPTask.htm

  • see next post (somthing went wrong posting it)

  • Gate Crusher,

    For the SQL 2000 environment we use the XP_SMTP_SEND_MAIL procedure;

    Copy the appropriate DLL into the BINN directory

    Register this DLL within SQL server

    ready for use (script example);

    --Within the declare section of a SP

    ----------MAIL section -----------------------------------------------------------------------------

    declare @rc int

    declare @sent_email_to   varchar(80)

    declare @sent_email_cc   varchar(80)

    declare @sent_email_subject  varchar(140)

    declare @sent_email_message  varchar(8000)

    declare @attachments_details  varchar(400)

    set @sent_email_to         = 'someone@somehost.com'

    set @sent_email_cc         = ''

    set @sent_email_subject   = '<title of you e-mail>'

    set @sent_email_message  = '<E-mail body (can be assemble dynamicly)>'

    set @attachments_details  = '\\somesever\path\file' 

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

    << your main stript here >>

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

    set @sent_email_message = 'whatever you want to sent'

      

      @FROM           = N'return adres@somehost.com',

      @TO              = @sent_email_to,

      @cc               = @sent_email_cc,

      @subject        = @sent_email_subject,

      @message       = @sent_email_message,

      @attachments  = @attachments_details,

      @server           = N'mail.<your_server>.com'

    select RC = @rc

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

     

    Hope this offers new opportunities,

    Regard,

    GKramer

    The Netherlands

     

     

Viewing 7 posts - 1 through 6 (of 6 total)

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