我们可以在HTML邮件中使用PHP echo函数吗$messahe.='<H3>Phone:<?php echo


can we use php echo function in html mail $messahe .='<h3>phone:<?php echo $phone;?></h3>'

   <?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>';