I'm using this code to send mail to myself from a web page.
I want to attach a file to the email sent.
Can anyone help me?
I need code to look at, to understnd how it works.
PHP Code:<?
$subject = "{$_POST["subject"]}";
$message = "
<html>
<head>
<title>{$_POST["subject"]}</title>
</head>
<body>
Some links and text here
</body></html> ";
$headers = "From: MY.COM <[email protected]>\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* Attachments*/
$headers .= "Content-Type: image/jpeg; name={$_POST["attach"]}"
$headers .= "Content-Disposition: attachment; filename={$_POST["attach"]}"
mail("[email protected]", $subject, $message, $headers);
?>


Reply With Quote