Answered by:
CRM 2011 - Send email using JavaScript

Question
-
I'm trying to customize the action of the Send button in the e-mail entity. I exported a solution with this entity, modified the customizations.xml file so that it would call a user defined function. It works fine. That function evaluates whether the mail should be sent or not. The problem is I can't find the way to send the mail from within the function!
I tried something like
Mscrm.Form.email.Send()
but it's not a valid option...
I think there must be a way to do it simply. Can anyone help me on this?
Thanks in advance!
Monday, October 15, 2012 10:02 PM
Answers
-
Hello,
It's pretty simple. Just call send(); function like:
function sendemail()
{
send();
}
- Marked as answer by dani la morte Tuesday, October 16, 2012 12:22 PM
Tuesday, October 16, 2012 8:03 AMModerator
All replies
-
Not supported but this should work:
crmForm.SubmitCrmForm(CRM_EMAILFORM_EMAILSEND,true,true,false);
CRM_EMAILFORM_EMAILSEND = 7Jason Lattimer
- Proposed as answer by JLattimerMVP, Moderator Tuesday, October 16, 2012 1:40 AM
Tuesday, October 16, 2012 1:40 AMModerator -
I think you will have to execute a "SendEmailRequest" using XMLHttpObject. Because sending an email should anyway go through the CRM server. So according to me, a service call would be required to make it a supported solution.
- Proposed as answer by Rugved Gokhale Tuesday, October 16, 2012 7:04 AM
Tuesday, October 16, 2012 7:04 AM -
Hello,
It's pretty simple. Just call send(); function like:
function sendemail()
{
send();
}
- Marked as answer by dani la morte Tuesday, October 16, 2012 12:22 PM
Tuesday, October 16, 2012 8:03 AMModerator -
Thank you people for your answers. Calling the function send did work. Simpler than I thought. :-)Tuesday, October 16, 2012 12:22 PM