Add both name and address values into the email address : mail « Utility Function « PHP






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

1.mail() function mails information to a given recipient.
2.mail-javascript.php
3.Using mail() to redirect user information
4.Encrypting and Sending Secure Emails Using S/MIME
5.send-email-multiple-recipients-2.php
6.send-email-with-headers.php
7.send-mail-multiple-recipients.php
8.send-plaintext-email.php
9.Sending user-requested information
10.Sends a HTML mail from a given email address:
11.Sending Internet Mail
12.Sending Mail
13.Sending a message with mail()