0

定制了我自己的邮件脚本。php新手在这里所以请多多包涵。这是代码。我只想在主题和消息上添加斜杠,如果是这样,它不会也删除我用 \r\n\r\n 制作的斜杠吗?

$headers="From: {$email}\r\nReply-To: {$email}"; //create headers for email
$content="Name: ".$name."\r\n\r\nCompany: ".$company."\r\n\r\n
Subject: ".$subject."\r\n\r\n
Message: ".$message;
mail('opps@gmail.com',$subject,$content,$headers); //mail the message;
$success = "Thank you! You're email has been sent.";
#done;

谁能告诉我在哪里放置主题和消息的斜杠?多谢你们!

4

2 回答 2

2

按照下面的代码:

  "Subject: ".stripslashes($subject)."\r\n\r\n
  Message: ".stripslashes($message);
于 2014-02-27T05:11:39.457 回答
1
$email = stripslashes($email);
$name = stripslashes($name);
$company = stripslashes($company);
$subject = stripslashes($subject);
$message = stripslashes($message);

$headers="From: {$email}\r\nReply-To: {$email}"; //create headers for email
$content="Name: ".$name."\r\n\r\nCompany: ".$company."\r\n\r\n
Subject: ".$subject."\r\n\r\n
Message: ".$message;
mail('opps@gmail.com',$subject,$content,$headers); //mail the message;
$success = "Thank you! You're email has been sent.";
#done;
于 2014-02-27T05:12:24.383 回答