我发送的邮件带有预定义的签名
define('Signature', 'Our Great Support Team');
所以电子邮件正文如下:
$msg = 'Hails folks. <br />Thanks for your time, blah-blah <br />'.Signature.';
效果很好..但它必须作为PLAIN TEXT发送
$msg = "Hails folks\nThanks for your time, blah-blah\nSignature";
显然 - 这不会奏效。
这可以通过添加变量来解决:
$signature = Signature;
$msg = "Hails folks\nThanks for your time, blah-blah\n$signature";
这会有效但可以更容易吗?类似的东西:
$msg = "Hails folks\nThanks for your time, blah-blah\nconstant('Signature')";
答案 0 :(得分:0)
您可以使用sprintf函数
来完成此操作define('Signature', 'Our Great Support Team');
$msg = sprintf('Hails folks. <br />Thanks for your time, blah-blah <br /> %s', Signature);