PDA

Click to See Complete Forum and Search --> : I need help with attachments


New to VB 6
Jan 16th, 2003, 12:39 PM
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.

<?
$subject = "{$_POST["subject"]}";

$message = "
<html>
<head>
<title>{$_POST["subject"]}</title>
</head>
<body>
Some links and text here

</body></html> ";

$headers = "From: MY.COM <me@my.com>\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("me@my.com", $subject, $message, $headers);
?>

The Hobo
Jan 16th, 2003, 04:40 PM
http://www.phpbuilder.com/columns/kartic20000807.php3