I have been struggling all afternoon trying to get a simple mailto:
tag to work. I've scoured the internet, but so far none of the suggested fixes have solved the problem.
The Problem
I have a webpage that I want users to be able to send an email from. This page will be used on an internal network, and requires that a recipient, subject, and body is dynamically added to the message when the button is clicked.
To solve the problem, I am trying to use the mailto tag, and Groupwise 8 launches a new message correctly when I only have a recipient listed. However, when trying to set anything other than the To: field, the data is simply appended to the To: field.
For example, in my jsp page I have this:
<script type="text/javascript">
function sendMail() {
alert('Trying to send mail!');
var link = "mailto:myaddress@mydomain.org"
+ "?subject=Testing the automated email template"
+ "&body=Testing testing testing"
;
window.location.href = link;
}
</script>
...
<input type="button" onclick="sendMail();" value="Send email" />
So when I click the button, I would expect an email to myaddress@mydomain.org, with a subject of "Testing the automated email template", and a body of "Testing testing testing". Instead, however, the entire link string is simply put into the To: field of the email message.
I have tried a number of variations of mailto, embedding the mailto into an <a>
tag instead of Javascript, and escaping the string. Nothing changes the outcome when Groupwise creates the new message.
Any advice on how to fix this issue is greatly appreciated!