Sending email by plug-in in CRM2011
-
Monday, April 30, 2012 3:35 AM
Hi all,
I looking for a way to send an email after an entity is updated, by plug-in; May I have some references to study please?
I read http://social.microsoft.com/Forums/en/crm/thread/1376c8cc-9ca6-4e5b-84a8-8bde15c14708, but it not yet answered. I also read http://rajeevpentyala.wordpress.com/2011/08/03/sending-an-email-using-crm-2011-plug-in/; it return no error but also no email or activities attached in the entity.
I can find the email record in the "email" entity in database but no email received at all....
Please advise and comment, many many thanks.
All Replies
-
Friday, April 27, 2012 9:21 AM
Hi all,
I looking for a way to send an email after an entity is updated, by plug-in; May I have some references to study please?
I read http://social.microsoft.com/Forums/en/crm/thread/1376c8cc-9ca6-4e5b-84a8-8bde15c14708, but it not yet answered. I also read http://rajeevpentyala.wordpress.com/2011/08/03/sending-an-email-using-crm-2011-plug-in/; it return no error but also no email or activities attached in the entity.
Please advise and comment, many many thanks.
- Merged by DavidJennawayMVP, Moderator Monday, April 30, 2012 8:56 AM Duplicate thread. Replies are in CrmDevelopment forum
-
Friday, April 27, 2012 9:32 AM
Hi,
As your second blog, you say you are able to execute but email is not attached in the entity. This means the email activity is created fine?
Check in your code whether you are passing correct regardingobjectid and entity name (to which you need to attach that email).
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
- Proposed As Answer by Ashish Mahajan Australia (Architect) Friday, April 27, 2012 9:33 AM
-
Friday, April 27, 2012 10:01 AM
hi Asnish Mahajan, thanks for your reply.
Sorry about that, may I ask how can I check my email activity is created or not please?
because I found it didnt attached as closed event in the entity, I expect that it is not created well, however I not sure if it is right...
-
Friday, April 27, 2012 10:09 AM
Hi,
Go to your Activities link on left hand side in workplace and go to emails and search for it.
Or go to your entity record and your activities link on left hand side.
The other thing you can do is when you are running your plugin, have your plugin throw exception. In that exception message try to output the GUID of email activity if generated or after every few lines try to throw exception and see where the problem lies.
The best thing would be to remote debug your plugin. Then you can step in every line and see whether everything is executing fine.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
- Proposed As Answer by Ashish Mahajan Australia (Architect) Friday, April 27, 2012 10:09 AM
-
Monday, April 30, 2012 1:19 AMHi again, and thanks for the reply, let me have some try.....
-
Monday, April 30, 2012 1:23 AM
Good luck!
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
-
Monday, April 30, 2012 2:25 AM
Hi
I found that I can find the record in the table "Email" in database. but i found no email received in the recipient address.....
May I ask is that the email must be route by the CRM email routing server? because I was trying this with the Outlook addon but not email routing server....
-
Monday, April 30, 2012 2:30 AM
Hi,
If the email is through outlook client or IE and using CRM then yes, it should go via email router and exchange. In case you are sending email just through outlook and not tracking in CRM, then it will not be tracked in CRM and will go only through your exchange.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
- Proposed As Answer by Ashish Mahajan Australia (Architect) Monday, April 30, 2012 2:30 AM
-
Monday, April 30, 2012 2:40 AM
Thanks for the reply, but may I ask more as I feel a bit confused? Because when I use the CRM outlook addon, I can add and send email to different lead , account or any entities that valid for email or mail merge. But when I move to the Plug in , i got no email received.....
May I ask if i move the email sending process into a Plug in, even do I modify the data in the CRM outlook addon, I will need the CRM routing server to do the job but cannot replace by outlook itself?
many thanks
-
Monday, April 30, 2012 4:58 AMModerator
Have configured email integration ??, did you try to enable trace and see if you are getting some error details there ??
Mahain : Check My Blog
Follow me on Twitter
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question. -
Monday, April 30, 2012 5:24 AM
Did you refer following links as well?
http://rajeevpentyala.wordpress.com/2011/08/03/sending-an-email-using-crm-2011-plug-in/
http://crm2011andsilverlight.blogspot.in/2012/02/sending-email-from-xrmcrm-plugin.html
Thanks, Ankit Shah
Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html -
Monday, April 30, 2012 6:06 AM
Hi Machender Pal, thanks for your reply.
I dont have the CRM Email Routing Server, I try the setting by the CRM Outlook Addon.
When I use the Outlook Addon to Add email to account, lead or other entities, it work fine and the email can send and receive well; I try to modify the records in my Outlook and trigger the entity UPDATE event by Plugin; But its not working. So I am in doubt if I use plug-in, is that I MUST have the CRM Email Routing Server as gateway, but not Outlook?
would you mind please give me some comment or advise in the case please? many thanks
- Edited by Ksun_Chan Monday, April 30, 2012 6:10 AM
-
Monday, April 30, 2012 6:09 AM
Hi Ankit Himmatlal Shah, thanks for your reply.
Yes, I find difference reference from internet, the 2 you post I read before. They all work similarly. I can find the record created well in the Email entity, it retrieve the subject, body, sender and recipient adress correctly, but the email didnt sent as well....thats why I dont know whats going on....would you mind to give me some comment or advise in my issue please? many thanks
-
Wednesday, June 20, 2012 7:42 AM
Hi Ksun_Chan,
I have the same requirement but little different..
Is it possible you to show the code????
Thanks in Advance...

