如何在PHP中格式化电子邮件

时间:2016-06-03 17:54:41

标签: php email

我可以在电子邮件中发送包含变量的电子邮件,但我无法在邮件中添加换行符。我尝试了一切我能在网上找到的东西。我正在使用表单生成一个创建帮助台票证的电子邮件。除了HTML电子邮件之外,我认为服务台不会。

        $rname=$_POST["rname"];
        $fname=$_POST["fname"];
        $lname=$_POST["lname"];
        $supervisor=$_POST["supervisor"];
        $phone=$_POST["phone"];
        $pforward=$_POST["pforward"];
        $email=$_POST["email"];
        $eforward=$_POST["eforward"];
        $eddate=$_POST["eddate"];
        $trdate=$_POST["trdate"];
        $description=$_POST["description"];

        $this->email->to('test@test.gov');

        $this->email->subject('An Employee Access Termination Request has been Submitted');

        $this->email->message(' Requestor Name: ' .$rname. ' Employee First Name: ' .$fname. ' Employee Last Name: ' .$lname.' Supervisor Name: '.$supervisor.' Phone: '.$phone. ' Phone Forward: '.$pforward. ' 
            Email: '.$email. ' Email Forward: '.$eforward. ' Employee Disconncet Date: ' .$eddate. ' Technology Return Date: ' .$trdate. ' 
            Special Instructions: ' .$description .= "Please remove access from any other systems such as KLAS Evergreen LIMS and or the Drupal WebSites");

1 个答案:

答案 0 :(得分:0)

这适用于我的PHP表单:

"\n"

这对我不起作用

"<br>" or "<br />"