In a message dated 2/23/2004 11:41:00 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:

>is possible to send an email, with mail() function, with an attached?
>I see on www.php.net but there isn't nothing about this.
>If someone have the solution please send the solution.
>Thanks in advance.
>Frank

You do it by including an email header that instructs that the message be
sent as an attachment, like the following:

$to = "[EMAIL PROTECTED]";
$subj = "Testing an attachment";
$mess = "This is the test message.";
$headers = "Content-disposition: attachment; filename=test.txt\n";
$mailsend = mail($to,$subj,$mess,$headers);

This will send the message in $mess as an attachment with the filename
test.txt.

Good Luck,

Janet

-----------------------------------
Janet Valade, 
Author, PHP & MySQL for Dummies
Author, PHP 5 for Dummies
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to