Thanxs... I couldn't use your script (because of my lack of experiencie
maybe) but you gave me a very good hint about what to look for.
I sent an attachment (with a class located in this URL :
http://renoir.vill.edu/~ylee/mailfile.txt), but that wasn't what my boss was
thinking of.
(Now he tells !)
Anyway, is useful and I repeat my gratitude.

"Frank Hertogs" <[EMAIL PROTECTED]> escribió en el mensaje
000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp">news:000401c1ab7e$4b2e7790$3400a8c0@fritzzz57619dp...
> This should do the trick, experiment wit hit;
>
> function mail_attachment($email, $buffer)
>  {
> //subject
> $subject = "Testing pdf attachment.."
> //sender
> $x_sender = "F. Hertogs";
> //extra (optional) headers
> $x_headers = "From: [EMAIL PROTECTED]\n";
> $x_headers .= "PHP mailer\n";
> $x_headers .= "MIME-version: 1.0\n";
> //tell mail program it's multipart/mixed
> $x_headers .= "Content-type: multipart/mixed; ";
> //tell mail program what boundary looks like
> $x_headers .= "boundary=\"Message-Boundary\"\n";
> //encoding
> $x_headers .= "Content-transfer-encoding: 7BIT\n";
> //to prevent error in case email is empty (I only use this for testing
> //normally; use php or javascript to check forms before submitting
> if(!IsSet($email))
>  $email = "[EMAIL PROTECTED]";
> //first boundary
> $body = "--Message-Boundary\n";
> //start text message
> $body .= "Content-type: text/plain; charset=US-ASCII\n";
> $body .= "Content-transfer-encoding: 7BIT\n";
> $body .= "Content-description: Mail message body\n\n";
> //text for message
> $body .= "Dear sir,\n\nHere is the requested file blabla"
> //end text message
> $body .= "\n\n--Message-Boundary\n";
> //start application pdf in this example
> $body .= "Content-type: application/pdf name=\"attach.pdf\"\n";
> $body .= "Content-Transfer-Encoding: base64\n";
> $body .= "Content-disposition: attachment; filename=\"attach.pdf\"\n\n";
> $enc_pdf = chunk_split(base64_encode($buffer));
> $body .= $enc_pdf . "\n"; }
> $body .= "--Message-Boundary--\n";
> //mail actual message
> mail($email, $subject, $body, $x_headers);
> }
>
> I hope this helps you.
>
> Frank.
>
> -----Oorspronkelijk bericht-----
> Van: Mauricio Sthandier [mailto:[EMAIL PROTECTED]]
> Verzonden: vrijdag 1 februari 2002 20:45
> Aan: [EMAIL PROTECTED]
> Onderwerp: [PHP] Email Attachment
>
> Hello, I'm new in php development... I was wondering how can I attach a
> Word
> (.doc) Document in an email sent with the mail() function (if I can do
> it
> just with it).
>
> I know it has to see with the additional headers of the email, but I
> would
> be grateful If anyone could tell where can i go to for this specific
> information.
>
> I couldn't find it in PHP manual (.pdf version).
>
> Thanxs !
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



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

Reply via email to