Re: [PHP] email attachment cannot be opened (solved)

2003-09-12 Thread Chris Hayes
I found the culprit!
I copied the filereading part without checking too good, and it had an 
"addslashes" call which ruined the file content very professionaly.

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


Re: [PHP] Email-attachment not working

2002-05-02 Thread Ashley M. Kirchner

Jason Wong wrote:

> On Thursday 02 May 2002 19:31, 1LT John W. Holmes wrote:
> > > Do we have to upload the file first, which is to be attached?
> >
> > No. When you press the submit button, just speak slowly and clearly where
> > the file is and PHP will understand you. What kind of video card do you
> > have?
>
> I prefer faxing the file over to the server.

It's much easier holding it up to the screen and scanning it in.
Try it sometime.  You'll love it.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner    .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




Re: [PHP] Email-attachment not working

2002-05-02 Thread David Robley

In article <001401c1f1cc$f5461dc0$2f7e3393@TB447CCO3>, 
[EMAIL PROTECTED] says...
> > Do we have to upload the file first, which is to be attached?
> 
> No. When you press the submit button, just speak slowly and clearly where
> the file is and PHP will understand you. What kind of video card do you
> have?
> 
> ---John Holmes...
> 
> 

Now I have to clean coffee off my monitor

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




Re: [PHP] Email-attachment not working

2002-05-02 Thread Jason Wong

On Thursday 02 May 2002 19:31, 1LT John W. Holmes wrote:
> > Do we have to upload the file first, which is to be attached?
>
> No. When you press the submit button, just speak slowly and clearly where
> the file is and PHP will understand you. What kind of video card do you
> have?

I prefer faxing the file over to the server.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
micro:
Thinker toys.
*/

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




Re: [PHP] Email-attachment not working

2002-05-02 Thread 1LT John W. Holmes

> Do we have to upload the file first, which is to be attached?

No. When you press the submit button, just speak slowly and clearly where
the file is and PHP will understand you. What kind of video card do you
have?

---John Holmes...


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




Re: [PHP] Email Attachment

2002-02-04 Thread Mauricio Sthandier

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




RE: [PHP] Email Attachment

2002-02-01 Thread Frank Hertogs

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, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Email Attachment

2001-02-03 Thread Richard Lynch

> I know how to send a standard email, but I`m having a bit of trouble
adding
> an attachment, can anyone put me right?
>
> this is my code which works fine...
>
> $subject="Hi";
> $email="[EMAIL PROTECTED]";
> $from="[EMAIL PROTECTED]";
> $message="Hi this is me testing my PHP mail script";
>
> mail($email, $subject, $message, $from);

Email attachments are quite a bit more convoluted than just adding a From
header...

You may want to use Manuel Lemos email class or some other pre-written
user-contributed function to do it.

Otherwise, you get the joy of figuring out MIME-encoding and making up
unique boundary lines to segment the mime-parts and other gnarly stuff I've
managed to not have to figure out...

Even if you want to roll your own, read their source as well as the RFCs
they used to figure all this out.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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]