How can I use the Private Message module for anonymous users?
The Privatemsg module CANNOT be used for anonymous users ... Unless you are ready for some "tweaks" ... as detailed below.

I'm assuming your question is about D7, if it is for D6, you might consider using what's described in Issue # 490264. But it's worth reviewing that issue to get "an idea" about a possible work around ...

So how about D7? Issue # 554238 is about D7, and Comment #7 in it refers to the issue I mentioned above (which is for D6). However Comment #8 in that issue might be the solution. It contains this code sample:

&lt;?php
$msg = "Hello there";
$source_tag = "from {$_SERVER['REMOTE_ADDR']}";
$result = privatemsg_new_thread( array(user_load(1)), "Browser visit {$source_tag}", $msg, array('author' =&gt; user_load(1)) );
// If you wanted to show an error, uncomment the following:
if (!isset( $result['success'] ) || !$result['success'])
{
  printf( "&lt;p&gt;Failed to send: %s&lt;/p&gt;\n", $result['error'] );
}
?&gt;


Apart from what is above, there is also the (way more) recent issue # 2231795. Comment #1 in it contains a code sample also. So if the above code doesn't fit (or work), consider this as an alternative.

So by using the Privatemsg module, and some tweaks (see above) you should be able to make it work somehow for anonymous users also