PHP代码不发送电子邮件

时间:2013-06-20 12:55:34

标签: php email

我在下面的代码中提供了一个模板和信息来发送一些我没写过的PHP代码的电子邮件。但是我需要尝试让它工作。在编码时我非常基本,所以任何帮助都会受到赞赏。谢谢!

$fh = fopen('templates/customer.eml','r');

        $emailContents = fread($fh, filesize('templates/customer.eml'));
        $emailContents = str_replace(":name:", $person->first . " " . $person->last, $emailContents);
        $emailContents = str_replace(":meeting_name:", $meeting->name, $emailContents);
        $emailContents = str_replace(":chair:", $chair->first . " " . $chair->last, $emailContents);

        fclose($fh);

        $header = "FROM: vra@vodafone.com\r\n";
        $header .= "MIME-Version: 1.0\r\n";
        $header .="Content-type: text/html; charset: utf8\r\n";
        mail($person->email , "Meeting Request", $emailContents, $header);

        echo $person->email;

0 个答案:

没有答案