Problem with sending mail in SQL Server 2000

  • I want to send message to SO to notify the result of command executing but nothing happen. I am using Outlook Express Mail.

    This is my code for that :

    declare @hr int,@MailID int

    EXEC @hr = sp_OACreate 'CDONTS.NewMail', @MailID Out

    EXEC @hr = sp_OASetProperty @MailID, 'From','phuc.pham@pcv.net'

    EXEC @hr = sp_OASetProperty @MailID, 'Body', 'Insert new Date fail !'

    --EXEC @hr = sp_OASetProperty 1, 'BCC',@BCC

    --EXEC @hr = sp_OASetProperty 1, 'CC', @cc

    EXEC @hr = sp_OASetProperty @MailID, 'Subject','Fortis'

    EXEC @hr = sp_OASetProperty @MailID, 'To','phuc.pham@pcv.net;vu.duong@pcv.net'

    EXEC @hr = sp_OAMethod @MailID, 'Send', NULL

    EXEC @hr = sp_OADestroy

    Please tell me what problem is.

    Thanks in advance!

  • First, visit here: http://support.microsoft.com/kb/312839

    Then

    • check services in your SQL server. See if SMTP(Simple Mail Transport Protocol) is started. If disabled, set it to Automatic or Manual then start it.
  • Thanks for your reply!

    I will try it.

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

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