Add both name and address values into the email address
<?
$mailtoname = "My Best Friend";
$mailtoaddress = "a_friend@example.com";
$mailtocomplete = "$mailtoname <$mailtoaddress>";
mail($mailtocomplete, "My Subject", "Hello, world!");
?>
Related examples in the same category