Question


BOA
IN
Last activity: 27 Feb 2025 4:21 EST
How to open outlook mail from button click
HI Team,
On click of button i should open email in outlook with predefined subject and from address. Please suggest how to implement.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 27 Feb 2025 4:21 EST


BOA
IN
@Pavani_Regulagedda I was able to resolved this by using a paragraph rule and pasting below content
<span style="font-size:14px;"><a href="mailto:[email protected]?Subject=hello test mail">Contact Us</a></span>


Maantic
IN
@Pavani_Regulagedda - you can use the below html to open the default email editor with pre-populated values. If outlook is your default client then it should open the new email with pre-populated values.
<a href="mailto:[email protected][email protected]&[email protected]&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party!" target="_top">Send mail!</a>
Updated: 21 Oct 2024 2:46 EDT


ARETEANS TECHNOLOGY SOLUTIONS PRIVATE LIMITED
IN
This can be done by using a Paragraph rule. In section call a label wherein call a paragraph rule.
In the Paragraph rule, you'll be having an option to add a link where pass the Protocol type as "Others" and URL as "mailto:[email protected]". And on clicking the URL again you'll get option to add Subject body to that link.


Swedbank AB
SE
@RiyaR417 - Could you please help me understand how to include multiple email addresses from a pagelist under "To" field in above approach?


Maantic
IN
@MadhuraM1401 - <a href="mailto:[email protected][email protected]&[email protected]&subject=Summer%20Party&[email protected];[email protected]&body=You%20are%20invited%20to%20a%20big%20summer%20party!" target="_top">Send mail!</a>
you can use this in the hyperlink &to= Proprietary information hidden; Proprietary information hidden
Updated: 7 Jan 2025 4:13 EST


Swedbank AB
SE
@MadhuraM1401RiyaR417 KALINGAROUT - How can we open outlook window with dynamic values from Pega. For example: We want to populate TO and CC email addresses from a pagelist present on the Clipboard. As of now, we can see that only hard coded values can be set in the suggested approach. How to populate email addresses dynamically from a Pagelist?
Updated: 14 Jan 2025 9:08 EST


Swedbank AB
SE
@All - It could be beneficial for everyone who are wondering about how to display dynamic values in an outlook email with a click of a button.. As described earlier, you can use a Paragraph rule in a section first. In that paragraph rule, add a link. Select "Source only mode" in the paragraph rule and write down HTML code as per your requirement. Save your changes. E.g. If you want to display dynamic values under TO, CC, SUBJECT or BODY etc. then please refer the code given below. You can set values of these properties(Propertyname1, Propertyname2, Propertyname3) in a data transform and put that data transform either in pre-processing or post-processing of flow action as per your need. <a href="mailto:<pega:reference name=".Propertyname1"></pega:reference> ?cc=<pega:reference name=".Propertyname1"></pega:reference>&subject=<pega:reference name=".Propertyname3"></pega:reference>&" >Send Mail</a> Above solution is working fine in our case. Hence, I thought of sharing it with others.


HCA Healthcare
US
To open an Outlook email with a predefined subject and body when a button is clicked, you can use the mailto:
protocol. Add a button in HTML and use JavaScript to attach a click event. In the event handler, create a mailto
link like mailto:[email protected]?subject=Your%20Subject&body=Your%20Message
, replacing the recipient, subject, and body with your desired values. Use encodeURIComponent
for the subject and body to handle special characters. Then, set window.location.href
to the mailto
link to open the default email client (e.g., Outlook) with the email ready to send. Note that the "From" address is determined by the user's Outlook account and cannot be set via mailto
. This approach works only if Outlook is the default email client on the system. For more advanced control, like setting the "From" address, you'd need to use the Microsoft Graph API
Accepted Solution
Updated: 27 Feb 2025 4:21 EST


BOA
IN
@Pavani_Regulagedda I was able to resolved this by using a paragraph rule and pasting below content
<span style="font-size:14px;"><a href="mailto:[email protected]?Subject=hello test mail">Contact Us</a></span>