How to fix attachments being sent as WinMail.dat

LinkedIn
Twitter
Facebook

Table of Contents

Have you been advised by the person you emailed that your attachment came through as WinMail.dat instead of the PDF attachment you actually sent. So what happened?

This sometimes occurs when Outlook sends emails out which contains some Rich Text Format (RTF) content.   Even if you set Outlook to send email as HTML format, some content is RTF and this is confusing Microsoft365’s Exchange server. One common cause is a signature that was created in Word and copied into Outlook. The RTF content causing the issue is usually the email signature ( created in Word and copied into Outlook).

Stop Outlook Sending Attachments as WinMail.dat

This is how you would fix the issue for everyone on Microsoft Office 365:

  1. Login into Microsoft Office 365 via PowerShell.
  2. Run PowerShell as admin
  3. Enter the command $UserCredential = Get-Credential
  4. Enter the requested login details when prompted
  5. Enter Set-ExecutionPolicy Unrestricted
    Fixing Winmail.dat issue for Outlook via Powershell
  6. Press [Y] for Yes or [A] Yes to All
  7. Enter $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  8. Enter Import-PSSession $Session
  9. Enter Set-RemoteDomain Default -TNEFEnabled $false
  10. You can check if the setting has been applied by typing in the command get-RemoteDomain | fl *
  11. You should see TNEFEnabled as False

And that should be it. All outgoing mail for either the user or users you changed the setting for, should now have their mail forced into HTML (or plain text) and not RTF.
 

Sign up to receive the latest news and offers from IT Networks​

About IT Networks

At IT Networks, we provide managed IT services designed to keep your business running smoothly and securely. From handling day-to-day IT operations to implementing robust cyber security solutions, we ensure your technology works seamlessly so you can focus on what matters most—growing your business. Let us streamline your IT infrastructure, enhance your security posture, and help you drive greater success.
Kim Pham - IT Network Security