Re: [PHP] mail attachment

2009-09-06 Thread Paul M Foster
On Sat, Sep 05, 2009 at 06:52:53PM +0200, Grega Leskov??ek wrote:

 How do I attach a file in mail function or do I have to use PEAR (and if how
 ...). What are the advantages of PEAR? When do You suggest to use PEAR?

You *can* attach something to an email using the mail() function, but
the process is complicated, and the mail() function isn't really set up
to do this. I believe the usual suggestion for users who ask this
question is to use the phpmailer package. It does this more easily.
Google for phpmailer.

Paul

-- 
Paul M. Foster

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



[PHP] mail attachment

2009-09-05 Thread Grega Leskovšek
How do I attach a file in mail function or do I have to use PEAR (and if how
...). What are the advantages of PEAR? When do You suggest to use PEAR?
Thanks in advance,
-- Peace refuge: http://users.skavt.net/~gleskovs/
When the sun rises I receive and when it sets I forgive;) Grega Leskovšek


Re: [PHP] mail attachment

2009-09-05 Thread Bastien Koert
RTFM

Bastien

On Saturday, September 5, 2009, Grega Leskovšek legr...@gmail.com wrote:
 How do I attach a file in mail function or do I have to use PEAR (and if how
 ...). What are the advantages of PEAR? When do You suggest to use PEAR?
 Thanks in advance,
 -- Peace refuge: http://users.skavt.net/~gleskovs/
 When the sun rises I receive and when it sets I forgive;) Grega Leskovšek


-- 

Bastien

Cat, the other other white meat

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



[PHP] Mail attachment

2003-03-18 Thread Liam Gibbs
I'm not sure why, but I get an attachment when sending out a mail with the following 
(see below). Well, I shouldn't say an attachment, but in Outlook I get that little 
paperclip, saying there is an attachment. But when I go to open the attachment, there 
is nothing there.I'm trying to send it to my Yahoo account, but it's not coming 
through there yet.

mail([EMAIL PROTECTED], Website Notice,  [messagebody], From: Liam [EMAIL 
PROTECTED]:[EMAIL PROTECTED]: text/ascii; charset=iso-8859-1\n);

If need be, I can post the message body, but I'm hoping someone can figure it out 
without the extra few K in everyone's mailbox.


Re: [PHP] Mail attachment

2003-03-18 Thread Chris Hayes
At 23:24 18-3-2003, you wrote:
I'm not sure why, but I get an attachment when sending out a mail with the 
following (see below). Well, I shouldn't say an attachment, but in Outlook 
I get that little paperclip, saying there is an attachment. But when I go 
to open the attachment, there is nothing there.I'm trying to send it to my 
Yahoo account, but it's not coming through there yet.

mail([EMAIL PROTECTED], Website Notice,  [messagebody], 
From: Liam 
[EMAIL PROTECTED]:[EMAIL PROTECTED]: 
text/ascii; charset=iso-8859-1\n);

If need be, I can post the message body, but I'm hoping someone can figure 
it out without the extra few K in everyone's mailbox.
It may be that the mail receiver expects some content after you put this in 
the header:
Content-Type: text/ascii; charset=iso-8859-1\n
If you're sending plain text, and no special (read: non-western) 
characters, i don't think you need that part.

And I would change this:
Liam [EMAIL PROTECTED]
to:
Liam [EMAIL PROTECTED]
but that's not causing your problem.


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


Re: [PHP] Mail attachment

2003-03-18 Thread Liam Gibbs
 It may be that the mail receiver expects some content after you put this
in
 the header:
  Content-Type: text/ascii; charset=iso-8859-1\n
 If you're sending plain text, and no special (read: non-western)
 characters, i don't think you need that part.

That was the fix. Yer a goldmine. Thanks!


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



Re: [PHP] Mail attachment

2003-03-18 Thread -{ Rene Brehmer }-
On Tue, 18 Mar 2003 23:19:08 +0100, Chris Hayes wrote about Re: [PHP]
Mail attachment what the universal translator turned into this:

It may be that the mail receiver expects some content after you put this in 
the header:
 Content-Type: text/ascii; charset=iso-8859-1\n
If you're sending plain text, and no special (read: non-western) 
characters, i don't think you need that part.

If you use any highbit characters (128) you need it, otherwise the
recipient's client can't figure out what codetable they're in...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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



RE: [PHP] mail() + attachment

2002-04-21 Thread Boaz Yahav

Class for sending mail with MIME attachments in multipart format using
external send mail, mime code and zip
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=336

Class to send a file as an attachment with the php mail() function.
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1583

How-to send e-mail with attachments ( with some corrections ) 
http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1260

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.



-Original Message-
From: Wolf-Dietrich von Loeffelholz [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 20, 2002 10:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mail() + attachement


Is it possible to send with mail an attachment .. if yes, how ???

Greetings
wolf


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




[PHP] Mail Attachment for Photo

2002-03-13 Thread Mark Lo

Hi All,

I am trying to do a mail attachment for photo(jpeg file) by using
php mail function and qmail server.  I have used the following mime format
to send out photo attachment provide by
http://planetkiller.shadow.net.au/mime-php.txt.  But When I received the
mail in Outlook Express, they are in garbage like 1253254dfafafadgas.

   And the most funny things is that if the mail message has been
modified on the server before downloading to Outlook Express.  Then, I am
able to received the mail in normal situation when downloaded to Outlook
Express.

   By modified I means just to delete a quote or a word, then add it
back and then save the file.

The code is below.  Any body having any ideas.

Thanks in advance

Mark Lo
?
Function mailattachments($to,$subject,$body,$attacharray,$extraheaders)
   {
// Generate a unique boundary
 $mail_boundary =b. md5(uniqid(time()));
// MIME-compliant headers
  $mailheaders = $extraheaders
   .MIME-Version: 1.0\r\n
   .Content-Type:
multipart/mixed;boundary=\$mail_boundary\\r\n
   .\r\n
   .This is a multi-part in MIME format\r\n
   .\r\n;

// Body. The part that gets displayed as the message:
 $mailbody = --$mail_boundary\r\n
.Content-Type: text/plain;charset=\iso-88592\\r\n
.Content-Transfer-Encoding: 7bit\r\n
.\r\n
.$body
.\r\n;

// Now, do the attachments
  for ($i = 0; $i  count($attacharray); $i++)
 {
   $fp = fopen($attacharray[$i][filename], r);
   $file = fread($fp, filesize($attacharray[$i][filename]));
   $file = base64_encode($file);  // BASE64-encoded. Text. Nice.
   $file = chunk_split($file);// Now in handy bite-sized 76-char
chunks.
   $filename = basename($attacharray[$i][filename]);
$mailbody .= --$mail_boundary\r\n
  .Content-Type:
.$attacharray[$i][mimetype].;name=.\$filename\\r\n
  .Content-Transfer-Encoding: base64\r\n
  .Content-Disposition: attachment;
  .filename=.\$filename\\r\n
   .\r\n
   .$file
   .\r\n
   .\r\n;
 }

// End of mail
  $mailbody .= --$mail_boundary--;
  mail($to, $subject, $mailbody, $mailheaders);
 }

$fileattach[] =
array(filename=/home/timeking/product/bigpic/yellowcomb.jpg,
  mimetype=image/jpeg);

Mailattachments(([EMAIL PROTECTED]),(Subject),(BodyMessages),($fileattach)
,(X-mailer));
?


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




[PHP] mail attachment query

2001-12-10 Thread caspar kennerdale

so i have a mail script which allows people to send attachments. This is
activated by an htmlform, which allows users to select the file from their
hard drive and post to the recipient.

The problem I have is this-

The file attachment is sent via email as a .dat file.

If I specify the name of the file and its attachment in a variable called
mail title all is well and good -

$mail_body .= Content-type:$mime_type; name=\$mail_title

This is of course if $mail_title is spomething likle mypicture.jpeg, if I
leave the extension out then it os sent as a dat file.

Now firstly the mime type might change depending onthe typeoffile the user
wishes to send-
it may be an swf or a doc. If the user specifies the type of file it is then
this is fine.

If the user doesnt specify the typeoffile being sent then all I have to go
on is the name of the file uploaded which appears as a temp name such as-

/tmp/phpHy3WIj

so is their any way of auto detecting thje mime type of a file from simply
the 'file' inpuit box on the form or at any other stgae-- or does the user
have to declare the type of file they are sending?

Thanks


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