Sending an email with an attachment using PHP

Associate
Joined
29 Dec 2004
Posts
2,253
I have a form that outputs an RTF file with PHP and saves it to a folder, now that this is done and tested i need to send this RTF file via email to a specified email address.

Someone mentioned using the PEAR Mail library, is that the best option for this situation?

So my question - is there a better way of sending an RTF attached to an email, or shoudl i be using PEAR?

Edit: I've also realised i have no idea how to install PEAR libraries if that is the best option...
 
Last edited:
yeah, PEAR mail and mail_mime are great for this. It's not a case of you have to use PEAR but it's SO much easier. I've only got experience installing them in linux, so if you're using Windows (which you appear to be) then I won't be much help!
 
Am testing it out on my shared hosting (Register1) first so thats Unix/Linux...can i get it working on there first or is it not possible with shared hosting?
 
if Register1 are nice, they might install it for you. Ask them nicely ;)

failing that, this explains how to do it. Scroll past all the crappy html and have a look at how they do the file attachment. Have a google for php mail attachment - there are a couple of things you can use there.
 
Register1 are always nice, blasphemy i tell you!

I've side stepped that now and installed it on Windows as it's easier to mess with code so all is ok, now i just have to work out what to do :)
 
Back
Top Bottom