可能重複:
Problem when loading php file into variable (Load result of php code instead of the code as a string)PHP郵件使用模板
我對下面的有點糊塗了......
信息提示功能
public static function MsgAlert($email, $name, $subject, $message)
{
$msg = include('mailer.php');
$subject = 'New Message';
if ($email != '' && validate_email($email))
{
$mailer = new PHPMailer();
$mailer->SetFrom(ADMIN_EMAIL, SITE_NAME);
$mailer->AddAddress($email);
$mailer->Subject = $subject;
$mailer->Body = Postman::nl2br($msg);
$mailer->AltBody = $msg;
$mailer->Send();
}
}
我已經把我的通訊設計成mailer.php,並請標記爲...
mailer.php
<div>
<h1><?php $subject; ?><span>27 September 2011 at 6:26 pm</span></h1>
<div>
<p>Hello <?php $name; ?>,</p>
<?php $message; ?>
</div> <!--message container -->
</div>
我使用正確的方法或我應該做些更美好因爲它不工作。請建議。謝謝。
和一個爲你實際鏈接到OB文檔+1。 –
感謝您的正確和快速的回答 – seoppc