Link to home
Start Free TrialLog in
Avatar of MrBarby
MrBarby

asked on

Sending an email attachment

Hi,

For my website, I want to write a feature that will allow me to send through an email attachment some of my hosted files to users.  However, once I have opened and read the file into a variable, i cant seem to actually make the attachment work :(

Can someone help me out?

Cheers

MrBarby
Avatar of Marcus Bointon
Marcus Bointon
Flag of France image

Don't bother using mail(). Download PHPMailer from phpmailer.sourceforge.net, upload it to your web area and call it with a script like the ones here:

http://phpmailer.sourceforge.net/tutorial.html#3
http://phpmailer.sourceforge.net/extending.html

You don't need to load the file before sending it, just point PHPMailer at the file and it will grab it for you.
Avatar of MrBarby
MrBarby

ASKER

OK, thanks, I'll give that a go :)
Avatar of MrBarby

ASKER

Hmm... I just tested this and it didn't seem to work.  Please note that I'm trying to download files that may not necessarily be from the same server, i.e. an http/ftp link.  Should this class still work with that?
ASKER CERTIFIED SOLUTION
Avatar of Marcus Bointon
Marcus Bointon
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial