top of page

TO , CC , BCC in PHP mail()

  • Writer: سُلَيْمَان بْن دَاوُوْد
    سُلَيْمَان بْن دَاوُوْد
  • Jun 5, 2020
  • 1 min read

Using mail() function to send mail with to , cc and bcc



$to       = 'nate@wpfixxyz.com'; 
$from     = 'nate@yopmail.com'; 
$bcc      = 'alan@brogan.com'; 
$headers  = 'From:  ' . $_POST['firstname'] .' '.$_POST['lastname'].' <' . $from .'>' . " \r\n" ;
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "Bcc: $bcc\r\n";
$mail = '  
    <table>
        <tr><th colspan="2">Appointment Registration</th></tr>
        <tr><td><strong>First Name</strong></td> <td>'.$_POST['firstname'].'</td> </tr>
       
    </table>';
 mail($to,'Appointment Registration',$mail,$headers);



Recent Posts

See All
Hide Upcoming Events

Hiding Upcoming Events can be relatively useful when you are using ACF fields to show Dates for an an Event The Following Snippet is an...

 
 
 

Comments


© 2020 by syednazrulhassan

bottom of page