I can already do this but the string arrives in the body of the message whereas I want it to arrive as an attachment and preferably with the filename "email.php".
Is it a simple matter of changing the header or am I out of my depth?
I can get it to arrive as an HTML attachment but that's not what I want and it has the filename "Enclosed.html" when my email client receives it.
Here's the script which achieves that so far. I've omitted the obvious parts:
- Code: Select all
// Set headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/txt; charset=iso-8859-1\r\n";
$f = "part1.txt";
$g = "part2.txt";
// Get text files
$part1 = implode('',file($f));
$part2 = implode('',file($g));
//Add files together with email address in place
$note = $part1 . $MFrom . $part2;
// And this is the actual email and the function to send it
","From: email@example.com" . "\r\n" . $headers . "\r\n");
Help/corrections would be very much appreciated.
Martin Pickering (UK)