
<?php (isset($id)) ? $id : $id = $modx->documentIdentifier; $pagelink = $modx->makeurl($id); // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $fromaddress = '[email protected]'; $to = $_POST['your_friends_email_from_your _form']; $subject = 'Your friend wants you to see this page!'; // Additional headers $headers .= 'From: '.$fromaddress. "\r\n"; $message = '<p>Please <a href="'.$pagelink.'">Click here</a> to view content.</p>'; // Send... if (mail($to, $subject, $message, $headers)) { return 'Page sent...'; } else { return 'opps!!!'; } ?>