Follow the code which is mentioned below to get rid of this situation.
Code:
<?php
function mail_attachment(, , , , ,, , ) {
= .;
= filesize();
= fopen(, "r");
= fread(, );
fclose();
= chunk_split(base64_encode());
= md5(uniqid(time()));
= basename();
= "From: ".." <"..">rn";
.= "Reply-To: ".."rn";
.= "MIME-Version: 1.0rn";
.= "Content-Type: multipart/mixed; boundary=""..""rnrn";
.= "This is a multi-part message in MIME format.rn";
.= "--".."rn";
.= "Content-type:text/plain; charset=iso-8859-1rn";
.= "Content-Transfer-Encoding: 7bitrnrn";
.= ."rnrn";
.= "--".."rn";
.= "Content-Type: application/octet-stream; name=""..""rn"; // use diff. tyoes here
.= "Content-Transfer-Encoding: base64rn";
.= "Content-Disposition: attachment; filename=""..""rnrn";
.= ."rnrn";
.= "--".."--";
if (mail(, , "", )) {
echo = "mail send ... OK"; // or use booleans here
} else {
echo = "mail send ... ERROR!";
}
}
Bookmarks