logo
search
Others

Fix SharePoint Event Receiver Cannot Send Emails With Attachments

Olivia MillerOlivia Miller Sep 28, 2026 869 views

Question details

A custom event receiver in SharePoint 2019 fails to send notification emails containing attachments, although built-in alerts and timer jobs still function normally.

How to Fix SharePoint Event Receiver Not Sending Emails With Attachments
Product
SharePoint 2019
Device & OS
not provided
Scenario
Developing or maintaining a custom SharePoint 2019 event receiver to send automated emails with file attachments.
Observed behavior
The event receiver stops sending emails when attachments are included, resulting in generic delivery failures without affecting native SharePoint alerts.
Before you start

Verify that your SharePoint Outbound SMTP server is properly configured and test that the SMTP server accepts the expected attachment file sizes before debugging your custom code.

Solution 1Recommended

Diagnose Custom Code and Check SharePoint ULS Logs

Because this involves custom SharePoint development, the most effective way to identify the root cause of email attachment failures is by analyzing the C# code execution and SharePoint Unified Logging Service (ULS) logs.

Built-in SharePoint alerts use optimized, pre-configured mail handlers, while custom event receivers rely entirely on your specific C# implementation. Issues such as prematurely disposed memory streams, timeout errors, or missing SMTP configurations can cause silent email delivery failures when attachments are added.

1
Review ULS Logs

Access your SharePoint 2019 server and open the ULS logs using ULS Viewer. Filter the logs for the correlation ID related to the time the event receiver fired to identify specific SMTP or stream errors.

2
Inspect email configurations

Navigate to SharePoint Central Administration. Go to System Settings > Configure outgoing e-mail settings, and ensure the Outbound SMTP server is correctly designated and reachable from the application server.

3
Check attachment memory streams

In your custom event receiver code, verify that the file attachment memory stream is not being closed, disposed of, or locked before the email sending utility finishes executing.

4
Post to Microsoft Q&A

Since custom code development falls outside standard configuration support, gather your ULS log snippets and reproducible C# code, and post a detailed question on Microsoft Q&A for specialized developer assistance.

Diagnose Custom Code and Check SharePoint ULS Logs
Developer Support Required: Custom event receiver logic requires developer-level troubleshooting. Reaching out to a SharePoint specialist or a dedicated developer community is highly recommended if log analysis does not reveal the issue.
Free Microsoft Office alternative

Need a Lightweight Alternative for Viewing and Editing Attachments?

While troubleshooting your SharePoint development issues, you may need a reliable office suite to handle and test the documents you are trying to attach. WPS Office is a free, lightweight, and highly compatible alternative to Microsoft Office.

  1. 1. Download the installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install WPS Office: Run the installer and follow the quick on-screen instructions to set up the office suite on your device.
  3. 3. Open your attachments: Set WPS Office as your default application to instantly open and edit any document or spreadsheet attachments.
High compatibility with Microsoft Word, Excel, and PowerPoint file formats (.docx, .xlsx, .pptx) for reliable attachment testing.Lightweight installation that opens large document attachments instantly without burdening your system.Built-in PDF reader and editor for managing PDF email attachments effortlessly.Familiar tabbed user interface, ensuring a seamless migration from Microsoft Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why do standard SharePoint alerts work while my custom event receiver fails?

Built-in SharePoint alerts use the internal timer service and robust internal mail handlers designed by Microsoft. Custom event receivers execute your own code, which might mishandle file attachment streams, encounter permission issues, or hit execution timeouts.

Can attachment file size limits cause the event receiver email to fail?

Yes. If the attached file exceeds the maximum message size permitted by your SMTP server (such as Microsoft Exchange), the server will reject the email request, often resulting in a silent failure within the event receiver if errors are not explicitly caught.

How do I test the SMTP connection directly from my SharePoint server?

You can test the SMTP connection by using the PowerShell 'Send-MailMessage' cmdlet directly on the SharePoint server, or by opening Command Prompt and using Telnet to connect to your SMTP server's IP address on port 25.

Can I use WPS Office to open document attachments downloaded from SharePoint?

Absolutely. WPS Office fully supports standard Microsoft Office formats like .docx, .xlsx, and .pptx, allowing you to seamlessly view, edit, and save any documents downloaded or synced from your SharePoint environment.