Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Show Attachment Size Message In CRM Email

(0) ShareShare
ReportReport
Posted on by 247

We have a CRM application and users can send emails from it. We want to show a warning message to user if the total size of the attachments they are attaching increases more than 20 MB.

For example, if they attach two files of 10 MB then the total becomes 20 MB and if they try to attach more files, I want to show them the error message or want to stop them some how. I tried setting email attach size to 20 MB under the System Setting but it didn't work. It stops the user from attaching file bigger than 20 MB, but user can attach several files of size less than 20 MB. 

Is there a way to show the message to user that total attach size should be less than 20 MB?

Thank you so much for your help. 

S

*This post is locked for comments

  • Suggested answer
    Rohtash Profile Picture
    10 on at
    RE: Show Attachment Size Message In CRM Email

    How did you do it,please suggest your code.

  • Suggested answer
    Rohtash Profile Picture
    10 on at
    RE: Show Attachment Size Message In CRM Email

    Please give your code , as i am new to plugin and urgently need the code

  • SamCRM1 Profile Picture
    247 on at
    RE: Show Attachment Size Message In CRM Email

    Hello, thank you so much. I was able to solve the problem using plugin.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Show Attachment Size Message In CRM Email

    Hi

    I have implemented something similar.

    1) Create a plugin on Email entity on stage 20 of Send message (PreEmailSend)
    2) Inside the plugin you would get the Email Guid ((Guid)context.InputParameters["EmailId"])
    3) Using the email guid (objectid equal emailGuid), get the attachment size(filesize is the logicalname) from activitymimeattachment entity
    4) If the total size exceeds your limit, throw InvalidPluginExecutionException

    Note that user get the message only when user click the Send button.

    Thanks,

    Charmis

  • Verified answer
    ashlega Profile Picture
    34,477 on at
    RE: Show Attachment Size Message In CRM Email

    The easiest might be to create a plugin which, on create of attachment, would calculate the total size of all attachments for the parent email, and, if it's more than 20Mb, would throw an error

  • Suggested answer
    jestuder Profile Picture
    158 on at
    RE: Show Attachment Size Message In CRM Email

    Are they attaching these directly in CRM or via Outlook?  The reason I ask is CRM attachment size is limited in the system settings.  Unless you changed that to 20MB, you won't be able to attach that size of a file in CRM.  If it is via outlook, then I believe that is a setting you can set within the exchange server itself.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans