<?php
$to = 'maryjane@email.com';
$subject = 'Marriage Proposal';
$from = 'peterparker@email.com'; // To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "'r'n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "'r'n"; // Create email headers
$headers .= 'From: '.$user_email."'r'n". 'Reply-To: '.$user_email."'r'n" . 'X-Mailer: PHP/' . phpversion(); // Compose a simple HTML email message
$message = '<html><body>'; $message .= '<h3 style="color:#f40;">Email:<?php echo $from;?></h3>'; $message .= '<h3>Phone:<?php $phone;></h3>'; $message .= '</body></html>'; // Sending email
if(mail($to, $subject, $message, $headers))
{
echo 'Your mail has been sent successfully.';
} else{
echo 'Unable to send email. Please try again.';
}
?>
$message = '<html><body>';
$message .= '<h3 style="color:#f40;">Email:'.$from.'</h3>';
$message .= '<h3>Phone:'.$phone.'</h3>';
$message .= '</body></html>'; // Sending email
如果它是一个PHP脚本,那么你可以使用任何PHP函数,包括echo。干净的方法——
echo '<h3>'.$phone.'</h3>';