[PHP] imap_open

2003-02-09 Thread Bartosz Matosiuk
hi

i'm using imap_open for opennig mailbox on the server where the script
is and everything is ok. I want also to open my mailbox on the other server
but script is behaving in a strange way. I looks like it's unable to open
that account but it is not giving me any error message.

I not sure but maybe this funcction can't be used in opening mailbox
which is on the other server than script and if so that what should I do to
open that account?

Have anyone got any suggestions???

thanks
bartek matosiuk



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




Re: [PHP] reading attachmentsl

2003-02-01 Thread Bartosz Matosiuk
hi
well actually I know what is the mechanism of sending mime messages with
atttachments works, the problem is that I don't know how to to read
attachment. I tried to use Pear decode functions but it only gives me info
that there are attachments in the message which is obviosly not enough.

so I'm putting my question once again: how to read attachment from the
mime message and how to save it on client hard drive???

thanks for any help
brtek

Uzytkownik Chris Hayes [EMAIL PROTECTED] wrote
 At 11:11 31-1-2003, you wrote:
 hi all
 
  I'm writing a mail client and I got problem with attachments. I have
no
 idea how to read and save attachments. Mayby someone already did
something
 like that a can help me with some advice or giving me link to some
 resourses.
 Maybe it helps to see how an attachment is send, then you can try to
 reverse the process to read in attachments.


 assume that $filedata holds the data you want to attach
 the encoding can done in many ways, so read the headers carefully

 //prepare mail body
 $filedata = chunk_split(base64_encode($filedata));
 $type = application/octet-stream;
 $encoding = base64;
  mt_srand((double)microtime()*100);
  $boundary = '--b'.md5(uniqid(mt_rand())) . getmypid();//so the
 boundary line can be quite diverse
  $mailbody = From: PHP backup script by Arakrys\n
  .MIME-Version: 1.0\n
  .Content-Type: multipart/mixed; 
  .boundary=\$boundary\\n\n
  .This is a MIME encoded message. \n\n
  .--$boundary\n
  .Content-Type: text/plain;
  //if ($this-charset != ) $mailbody .= ;
charset=$this-charset;
  $mailbody .=\n
  .Content-Transfer-Encoding: 8bit\n\n
  .$message . \n\n\n--$boundary;
 $data = Content-Type: $type.; name = \$filename\
  .\n .Content-Transfer-Encoding: $encoding
  .\n\n$filedata\n;
 $mailbody .= \n$data\n--$boundary
  .--\n;

 //send mail
 mail($mailto, $MYSQL_DB.' database backup '.date(d M Y H:i), ' ',
 $mailbody) or die ('Could not send email!');
 }




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




Re: [PHP] reading attachmentsl

2003-02-01 Thread Bartosz Matosiuk
hi
thanks for advices
I haven't ever heard about reformime, what is it?
brtek

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Saturday, February 01, 2003 4:40 PM
Subject: Re: [PHP] reading attachmentsl


 On Saturday 01 February 2003 23:21, Bartosz Matosiuk wrote:

  well actually I know what is the mechanism of sending mime messages
  with atttachments works, the problem is that I don't know how to to read
  attachment. I tried to use Pear decode functions but it only gives me
info
  that there are attachments in the message which is obviosly not enough.
 
  so I'm putting my question once again: how to read attachment from
the
  mime message and how to save it on client hard drive???

 1) You can see whether the functions in IMAP, POP3 and NNTP functions
are of
 any use.

 2) You can dissect a working PHP webmail application to see how others
have
 done it: www.squirrelmail.org etc

 3) You can make use of commandline programs to do the dirty work:
reformime
 etc.

 Personally, I've had good results using reformime.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Little prigs and three-quarter madmen may have the conceit that the laws
of
 nature are constantly broken for their sakes.
 -- Friedrich Nietzsche
 */



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




[PHP] reading attachmentsl

2003-01-31 Thread Bartosz Matosiuk
hi all

I'm writing a mail client and I got problem with attachments. I have no
idea how to read and save attachments. Mayby someone already did something
like that a can help me with some advice or giving me link to some
resourses.

greetz
bartek



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




[PHP] problem with copy()

2003-01-28 Thread Bartosz Matosiuk
hi

can the string source in copy () looks like that: c:\pic.jpg. If not
than how should it look like.

I'm not sure becouse script gives me Unable to open c:\pic.jpg for
reading: No such file or directory but the file is there.

and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me:
'Unable to open 'none' for reading: No such file or directory'.



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




[PHP] reading mail in php

2003-01-24 Thread Bartosz Matosiuk
hi

I'm writting an php application, a mail client, and I got a small problem.

Reading mail is quite simple if it's a normall text, but I'm not sure how to
read MIME mail. I thougt i could use eregi() and read separately every part,
but I'm not sure if it's the best way to do this. Maybe someone know the
better one.

thanks for any help
bartosz matosiuk




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