包含模板路径的PHP邮件

时间:2011-03-02 01:48:51

标签: include if-statement php

尝试以简单的方式发送PHP电子邮件,但我无法理解为什么这个不起作用。由于某种原因,它发送3封电子邮件,其全部内容为“1”。就是这样。

PHP

else if (isset($_GET['quoteemail'])) {
$email = include(TEMPLATEPATH . '/bookings/booking-quote.php');

$to = $current_user->user_email;
  $subject = "Your Order - Dive The Gap" ;
  $message = $email;
  $headers = "From: Dive The Gap Bookings <ask@divethegap.com>" . "\r\n" .
             "Content-type: text/html" . "\r\n";

  mail($to, $subject, $message, $headers);

}

如果在此功能之前,它们是IF或2,请不要担心。

任何想法,

非凡

1 个答案:

答案 0 :(得分:0)

include,包含一个文件,并在成功包含文件时告诉您“1”。

您可能希望查看函数:file_get_contents();