mime_mail.inc problem
| From: | Nicolas Windpassinger - Sun | Date: | Wed, 27 Dec 2000 15:41:38 +0000 |
| Subject: | mime_mail.inc problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31965@lists.php.net to get a copy of this message | ||
Hi all,
I have a problem using mime_mail.inc that i found on the archives of
the PHP list.
Here it is:
*INTRO
-------
-the company has to buildings
-each building has its own nfs cache (ex: in building1 /home/one/tmp
will not be the same as /home/one/tmp in building 2 )
*In my Apache server:
------------------------
- i use in a html form: Attach file 1:<input type=file name="file1"
size=15>
- i then play with file1 and mime_mail.inc:
#i check if the file1 exists
if ($file1){
line 64 -> $fd=fopen($file1,"r");
line 65 -> $data1=fread($fd,filesize($file1));
line 66 -> fclose($fd);}
#i then send an email
$mail=new mime_mail;
$mail->from ="TEster";
$mail->to ="nicolas.windpassinger@sun.com";
$mail->subject="testing";
$mail->body ="this is a test";
if ($file1){
$mail->add_attachment($data1,$file1,$content_type);}
$mail->send();
*The Problem is:
------------------
-If someone uses my html form in building2 then he gets the errors:
Warning: fopen("/home/tilly/tmp/falcon.txt","r") - No such file or
directory in /space/server/apache_1.3.12/htdocs/php/Manpagetool/eng1.php
on line 64
Warning: Supplied argument is not a valid File-Handle resource in
/space/server/apache_1.3.12/htdocs/php/Manpagetool/eng1.php on line 65
Warning: Supplied argument is not a valid File-Handle resource in
/space/server/apache_1.3.12/htdocs/php/Manpagetool/eng1.php on line 66
-I think it is because php tries to get the file from the path name, and
since it will not know if the person is in building one or two, then
it will search in the default building, which is the one where he is....
*What can i do??
-------------------
-Use Javascript to send the email??
-knock my head on the wall till i find the solution??
-or hope i will get an answer...
Thanks in advance,
Merry xsmas, happy new year.
Nicolas.