Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Add Text to e-Mail

Avatar

Level 2

Hi,

I had raised this question a cuple of days back as well and Srini had replied to it. However, I need to small modification to it. Currently on clicking the submit button, the user has to enter the "mailTo" for the mailing window to come up. I want the mailing window to come up even if the mailTo field is empty. having a value in the "cc" field is not a concern for me. But it would have been great if there is a way to get rid of both, and allow the user to enter the e-mail ID directly on the mailing window.

Regards,

Nakul

1 Accepted Solution

Avatar

Correct answer by
Level 10

Can you try this instead..

var oDoc = event.target;
oDoc.mailDoc({bUI: true,cTo: "",cCC: "",cSubject: "Subject text",cMsg: "Message Text"});

Thanks

Srini

View solution in original post

4 Replies

Avatar

Level 10

Nakul,

      In the sample that I sent you, all the parameters to the mailto method are optional..You can pass null values to ToAddress and CCAddress variables. Then a email window will open for the user with the subject and Body with the attachment. The To and CC will be blank.

      You can test this by not entering any value for ToAddress and CCAddress fields in the sample I sent you..

Thanks

Srini

Avatar

Level 2

Srini,

I am using MS Outlook. So, when I dont enter anything in that field, or enter a name which has multiple matches, it open up the "Check names" pop-up window associated with Outlook. However, when we use a normal E-mail submit button, even if no value is entered in the mailTo field, a mailing window directly opens up.

Regards,

Nakul

Avatar

Correct answer by
Level 10

Can you try this instead..

var oDoc = event.target;
oDoc.mailDoc({bUI: true,cTo: "",cCC: "",cSubject: "Subject text",cMsg: "Message Text"});

Thanks

Srini

Avatar

Level 2

YES!!!!!!!!!!!!!

It worked. Where do you refer this from? I don't even get any such code on google search.

Thanks a lot!!