Belfunk Posted October 12, 2007 Share Posted October 12, 2007 Hello, I am using Pear and its mime package to send an email with an attachment. The email sends properly but the attachment does not. I added a error function to see what the problem is and it says: File is not readable /root/Desktop/sample.txt A snippet of my code for it is: $mime = new Mail_mime($crlf); $crlf = "\r\n"; $status = $mime->addAttachment("/root/Desktop/sample.txt", "text/plain"); $mail = $smtp->send($to, $hdrs, $body); I have defined $to and $hdrs. I have set the permissions to 777. I dont know what the problem is. Any ideas? It will be much apperciated! Also, is this the easiest way to send attachments? All I need to do is just send one attachment to one email address. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/72941-sending-attachments-via-a-php-email-script/ Share on other sites More sharing options...
Belfunk Posted October 13, 2007 Author Share Posted October 13, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/72941-sending-attachments-via-a-php-email-script/#findComment-368367 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.