xp_smtp_sendmail Error 550 Relaying Prohibited

  • Have a DTS Package that creates a table, creates a file and then e-mails the created file.  I can send it internally anywhere, but cannot send it to an external address.   I made sure that my FireBox was allowing my SQL Server to send mail, and still not allowing me to send out.  Below is my code that is sending the file.  Thanks in advance.

     

    declare @Mail int

    Declare @datecreated as varchar(30)

    Declare @string as varchar(2000)

    Set @datecreated = Convert(varchar, Getdate(),112)

    SELECT @string = 'exec master.dbo.xp_smtp_sendmail

        @FROM       = ''myname@mydomain.com'',

        @FROM_NAME  = ''CV Eaton'',

    @TO         = ''myname@yourdomain.com'',

            @subject    = ''My files'',

        @message    = ''Attached are 401k Files,

        @type       = ''text/plain'',

         @attachment = ''d:\payrollfiles\metlife\ADDRSTERM01080144' + @datecreated +

    '.csv'',

        @server     = ''myexchangeserver'''

    Exec (@string)

    select MAIL = @mail

  • I could be wrong but that sounds like an smtp error message. You should check with you exchange admin to see if everything is configured to allow you to send out to the internet.

     

    then again I could be totally wrong

  • You have relaying disabled on the mail server. You will need to allowing relaying in order for this to work, make sure that if you enable relaying however that you restrict it to relaying only mail from certain ip addresses otherwise it could well end up as a spam host.



    Shamless self promotion - read my blog http://sirsql.net

  • stacenic said it all, but I just want to repeat the part about restricting access to an open smtp relay.  Make sure your network admin restricts SMTP relaying to only your sql servers ip, or at the very least your internal network.  I'm sure they'd understand the ramifications, but if not- you run the risk of being listed in those open relay blacklists.  Some admins reject mail from any site listed in certain blacklists.

    If I'm just spewing what's already common knowledge- sorry!  I understand it's quite difficult, if not impossible to get your url off some blacklists.  Only trying to save you or your company the hassle.


    -Ken

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

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