[英]open html file in php email
我目前有此代碼嘗試打開html文件並將其設置為$ mail_body。
include_('../forms/promo_email_form.html');
$mail_body = '';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: info@grillontherock\r\n";
我見過人們只是將常規的html文件放到$ mail_body中,但是我有大量的html文件,我不能而且更容易使用。
你們能給我示范代碼嗎? 謝謝!
正確,使用file_get_contents
而不是include
:
$mail_body = file_get_contents('../forms/promo_email_form.html');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.