views:

401

answers:

2

I am trying to configure SQL Server Reporting Services to send email. The environment is:

  • Windows Server 2008 Enterprise
  • SQL Server 2008 Enterprise
  • SSRS running in Native mode
  • SMTP server via IIS7, configured as a restricted relay

After a user configures a subscription for mail, when it's triggered the status changes to the following error:

Failure sending mail: The filename, directory name, or volume label syntax is incorrect. Mail will not be resent.

Here's the relevant section of rsreportserver.config:

<Extension Name="Report Server Email" Type="Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider,ReportingServicesEmailDeliveryProvider">
    <MaxRetries>3</MaxRetries>
    <SecondsBeforeRetry>900</SecondsBeforeRetry>
    <Configuration>
     <RSEmailDPConfiguration>
      <SMTPServer>
      </SMTPServer>
      <SMTPServerPort>
      </SMTPServerPort>
      <SMTPAccountName>
      </SMTPAccountName>
      <SMTPConnectionTimeout>
      </SMTPConnectionTimeout>
      <SMTPServerPickupDirectory>
       C:\inetpub\mailroot\Pickup
      </SMTPServerPickupDirectory>
      <SMTPUseSSL>
      </SMTPUseSSL>
      <SendUsing>
       1
      </SendUsing>
      <SMTPAuthenticate>
      </SMTPAuthenticate>
      <From>
       [email protected]
      </From>
      <EmbeddedRenderFormats>
       <RenderingExtension>MHTML</RenderingExtension>
      </EmbeddedRenderFormats>
      <PrivilegedUserRenderFormats>
      </PrivilegedUserRenderFormats>
      <ExcludedRenderFormats>
       <RenderingExtension>HTMLOWC</RenderingExtension>
       <RenderingExtension>NULL</RenderingExtension>
       <RenderingExtension>RGDI</RenderingExtension>
      </ExcludedRenderFormats>
      <SendEmailToUserAlias>True</SendEmailToUserAlias>
      <DefaultHostName>
      </DefaultHostName>
      <PermittedHosts>
      </PermittedHosts>
     </RSEmailDPConfiguration>
    </Configuration>
</Extension>

I've verified that the account that SSRS is running under has Full Control perms to the SMTP pickup directory (C:\inetpub\mailroot\Pickup) and its peers.

The ReportServerService log doesn't have anything revealing.

+1  A: 

The problem is that the SMPT server starts parsing the EML file as soon as it detects it. This is entirely fair, but the problem is that SSRS isn't always done writing the file - a race condition.

The solution is to instruct SSRS to write to a temp directory, then move the EML files to Pickup.

fatcat1111
A: 

okay, but how do i move the files instanly from some other directory to pickup drectory???

shobhit
In my scenario, mail throughput isn't a consideration, so we just have a robocopy job running. It adds a few seconds delay to the process, which is fine for us, but may not work for you.
fatcat1111

related questions