use PEAR::Mail();
it has all you need.

"James E. Hicks III" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You need a Content-Disposition in yer $mime variable. I'll leave it up to
you to
> figure out where, because I've forgotten where it goes exactly.
>
> James
>
>
> -----Original Message-----
> From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 16, 2002 8:46 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] email attachments
>
>
> This nifty code (taken from PHP Cookbook) sends an email with a file
> "attached" in-line.  The text from the attached file appears within the
> body of the email.  I need to send attached files that are not in-line,
> but, rather, come as attached files that the user views outside of their
> email browser.  Can somebody help me with this.  Maybe tweak the code
> I've got?
>
> Thanks!
>
> //attachment
> $to = $the_email;
> $subject = 'dump';
> $message = 'this is the dump';
> $email = '[EMAIL PROTECTED]';
>
> $boundary ="b" . md5(uniqid(time()));
> $mime = "Content-type: multipart/mixed; ";
> $mime .= "boundary = $boundary\r\n\r\n";
> $mime .= "This is a MIME encoded
> message.\r\n\r\n";
> //first reg message
> $mime_message .="--$boundary\r\n";
> $mime .="Content-type: text/plain\r\n";
> $mime .="Content-Transfer-Encoding: base64";
> $mime .="\r\n\r\n" .
> chunk_split(base64_encode($message)) . "\r\n";
> //now attach
> $filename = "mysqldump/surveydump.txt";
> $attach = chunk_split(base64_encode(implode("",
> file($filename))));
> $mime .="--$boundary\r\n";
> $mime .="Content-type: text/plain\r\n";
> $mime .="Content-Transfer-Encoding: base64";
> $mime .="\r\n\r\n$attach\r\n";
>
>
>
>
>
>
> mail($to,
> $subject,
> "",
> $mime);
>
>
>
> //attachment
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



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

Reply via email to