Skip to content

Instantly share code, notes, and snippets.

@mattsandersuk
Created July 7, 2014 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattsandersuk/e6aa957aff95e6b78f57 to your computer and use it in GitHub Desktop.
Save mattsandersuk/e6aa957aff95e6b78f57 to your computer and use it in GitHub Desktop.
Automatically populate email body with user agent string in mailto link.
<?php
$support_email = "help@example.com";
$browser = $_SERVER['HTTP_USER_AGENT'];
$email_subject = "Some email subject...";
$email_body = "<i>write message here</i><br><br><b>Please Keep</b> <br>" . $browser;
?>
<a href="mailto:<?php echo $support_email; ?>?subject=<?php echo $email_subject; ?>&body=<?php echo $email_body; ?>">Email Support</a></li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment