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">
       [email protected]

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.


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

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.

related questions