php send email tutorial code example

Example 1: php mail function

';
$message .= "We welcome you to be part of family

"; $message .= "Regards,
"; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= 'From: ' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; mail($to,$subject,$message,$headers); ?>

Example 2: how to send email with php

 or 
// 
  
  var Email = $_POST('email');
  var Number = $_POST('number');
  
$to_email = 'Your E-mail';
$subject = 'The Subject of the message';
$message = 'Name'.$name. "email" .$email. "number:" .$number.".";
$headers = 'From: noreply @ company . com'; //optional
mail($to_email,$subject,$message,$headers);
?>

Tags:

Misc Example