web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Sending email from plugins

(0) ShareShare
ReportReport
Posted on by

Hi There,

We have tried using the inbuilt email routing from within CRM but the overall admin of the site is not under our control and we're having some issues trying to get the person responsible to sort it out.

As an alternative we're wanting to use the System.Net.Mail library to send emails from within plugins but we're getting some issues. Specifically with the following error message when we send:

Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

We've tested the code locally in a test app so we know it works. I was wondering if there is something with Dynamics CRM that prevents us from sending out emails by this means or if there is something that I would need to configure to allow it through.

We're using Dynamics CRM 2013 online.

Many thanks

Dan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ScottDurow Profile Picture
    21 on at

    You are blocked from accessing non HTTP/HTTPS resources from sandboxed plugins in Dynamics CRM, and some parts of the .NET framework are also not accessible - see msdn.microsoft.com/.../gg334752(v=crm.6).aspx

    If you really can't get the Email Router configured (although this is the best practice method of sending emails from CRM) you will need to create an external webservice that you call from your plugin to send out emails.

    Hope this helps,

    Scott

  • Community Member Profile Picture
    on at

    Hi Scott,

    Thanks very much for the advice and the additional information.

    I will look at the alternatives you've suggested.

    Dan

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans