I have this handy little php script I use from time to time just to send out an e-mail:
Which works fine, except that it has no attachment functionality. It's been such a long time since I looked at this that I could do with some pointers on how to add this in.
Any ideas?
Code:
/* mail setup recipients, subject etc */
$recipients = "$Email";
$headers["From"] = "$Emailfrom";
$headers["To"] = "$Email";
$headers["Subject"] = "$Emailsubject";
$mailmsg = $Emailtext;
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "servergoeshere";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = false;
$smtpinfo["timeout"] = "5";
/* $smtpinfo["username"] = "smtpusername"; /*
/* $smtpinfo["password"] = "smtpPassword"; /*
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
Which works fine, except that it has no attachment functionality. It's been such a long time since I looked at this that I could do with some pointers on how to add this in.
Any ideas?