PHP mail attachment – sending an attachment with PHP

sending an email with php is easy, an attachment is a bit harder, but possible. Here are somethings you will need from the video

(note, just SOME of the things)
$content = chunk_split(base64_encode(file_get_contents($file)));
$header .= “Content-Type: multipart/mixed; boundary=””.$uid.””rnrn”;
$header .= “Content-Transfer-Encoding: base64rn”;
$header .= “Content-Disposition: attachment; filename=””.$file_name.””rnrn”;
$header .= “Content-type:text/plain; charset=iso-8859-1rn”;
$header .= “Content-Transfer-Encoding: 7bitrnrn”;

FAST VIDEO

source