Re: How to attach files with mail

From: Date: Mon, 22 Jan 2001 10:32:10 +0000
Subject: Re: How to attach files with mail
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-35984@lists.php.net to get a copy of this message
HI all, 1. mime_mail -------------- it is true that this class is just great, here is what i have done with it: $mail=new mime_mail; $content_type="application/octet-stream"; if ($file1){ l64 $fd=fopen($file1,"r"); l65 $data1=fread($fd,filesize($file1)); fclose($fd);} $mail->from ="Me; $mail->to ="$email"; $mail->subject="[Me] Request ok"; $mail->body ="$msg"; if ($file1){$mail->add_attachment($data1,$file1,$content_type);} $mail->send(); 2.BUT ------ be carefull I have BIG problems with it It gave me these 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 And the files do exist !!! I checked them ! So my question is: ------------------ how can we open and read the files locally, and not have this error come each time... If anyone can help i would be very thankfull, Nicolas. mick wrote: > > G'day Usman: > > I just happened to have this handy ... the attachment is a mime mail class > by Schumann/Ratschiller that I know works. Requires only minor changes if > any. Good luck. > > Michael Hall > > On Mon, 22 Jan 2001, Usman Ghani wrote: > > > Hello > > > > I am a new user of PHP. I hope that you guys would welcome me to this community. I am > > stuck on a problem that how to attach files with mail, when you are using mail( ) of PHP. > > If attachment is not possible using mail( ) then kindly let me know if there is any other > > function to send mails, in PHP which can serve this purpose. > > > > Waiting for reply. > > regards > > > > Usman > > > > ------------------------------------------------------------------------ > Name: mime.mail.class > mime.mail.class Type: Plain Text (TEXT/PLAIN) > Encoding: BASE64 > > ------------------------------------------------------------------------ > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#35984) next »