我正在使用这个简单的php邮件功能,我想在邮件中添加另一个文本,例如“此邮件来自网站”。
$email="kontakt@fotografernevesterbro.dk";
$from=$_POST["email"];
$subject=$_POST["subject"];
$message=$_POST["message"] + $sitemessage;
$sitemessage= "this is message from website";
mail ($email, $subject, $message, "From:".$from);
我尝试添加另一个变量并将其放入邮件功能但不起作用。
答案 0 :(得分:2)
使用.
连接(不是+
),$sitemessage
应在为$message
分配值后附加到$email="kontakt@fotografernevesterbro.dk";
$from=$_POST["email"];
$subject=$_POST["subject"];
$sitemessage= "this is message from website";
$message=$_POST["message"] . $sitemessage;
mail ($email, $subject, $message, "From:".$from);
。
checkUsage() {
while true; do
sleep 15
fileSize=$(stat -c%s $1)
sleep 10;
fileSizeNew=$(stat -c%s $1)
if [ "$fileSize" == "$fileSizeNew" ]; then
echo -e "[Error]: No activity noted on this window from 5 sec. Exiting..."
kill -9 $$
fi
done
}
答案 1 :(得分:-1)
此代码将完全按照您的意愿执行。
$email="kontakt@fotografernevesterbro.dk";
$from=$_POST["email"];
$subject=$_POST["subject"];
$headers = "From: $from ";
$message=$_POST["message"];
$message .= " this is message from website";
mail ($email, $subject, $message, $headers);