<div class="markdown">
<p dir="auto">On 24 Aug 2013, at 19:48, Nitin Goyal wrote:</p>

<blockquote>
<p dir="auto">Got it working with my scrappy Applescript :)</p>
</blockquote>

<p dir="auto">Great :-)</p>

<p dir="auto">But...</p>

<blockquote>
<pre><code>tell application "MailMate" to open location "mailto:" & (theReceiver) &     "?from=" & (theSenderl) & "
&subject=" & (theTitle) & "
&Body=" & (theURL) & "
&send-now=yes" with trust
</code></pre>
</blockquote>

<p dir="auto">You MUST use the <code>url_encode</code> function from the Alfred example for each of the values above. Otherwise it'll break for certain kinds of input and, even worse, you run the risk of code injection. For example, I could construct a webpage title, which would result in a <code>mailto:</code> URL telling MailMate to send any file on your disk to any email address.</p>

<p dir="auto">And just to be clear. It is <strong>not</strong>, in general, possible to use such <code>mailto:</code> URLs to make MailMate behave like that. It only works when opening a <code>mailto:</code> URL via AppleScript with the <code>with trust</code> bit seen above. (The reason you need the <code>with trust</code> above is that you want to “send now”.)</p>

<hr>

<p dir="auto">Benny</p>

</div>