$mail->Body = '';
我發現我要寄信時,我會寫入一整個 html + css 語法,還會添加 php 語言
就像是:
$mail->Body = '
<html>
<head>
'.$phpmailerCssStyle.'
</head>
<body>
<div class="edm-layout">
<img src="'.$host_url.'images/logo.png">
<div class="line"></div>
</div>
<div class="edm-content">
<div class="edm-hithere">
嗨,'.$getUser['name'].' <br>XXX '.$prodTotal.' XXXXX<br>XXXXXX'.formatProductPrice($thisTotal).' XXX
</div>';
$row_distinct = mysqli_fetch_array($cako_id_distinct);
$cako_data = $pdo->query(
"SELECT XXXXXXX "
);
$mail->Body .= '
<div class="edm-products">
'.$row_distinct['XXXX'];
//.......
</body>
</html>
類似那麼長的代碼
我是否可以把它收納到一個文件中,只要簡單引入就可以了?
$mail->Body = 'xxx.php'; or require_once...
有辦法實現嗎?
或其他方式?
至少我在這一頁的代碼不會看到這一長串的代碼.....
杨__羊羊
蓝山帝景