About wordpress email attachment

When i Send email with attachment the file name is optaining with temp characters in the prefix i just want the name the file with actual file name . Can anyone please help this problem

$uploaddir = ‘C:xampptmp’;
$myFile = $_FILES[‘my_file’];
$fileCount = count($myFile[“name”]);
for ($i = 0; $i < $fileCount; $i++) {
$uploadfile = $uploaddir . basename($_FILES[‘my_file’][‘name’][$i]);
if (!move_uploaded_file($_FILES[‘my_file’][‘tmp_name’][$i], $uploadfile)) {

break;
}
$attachments[$i] = $uploadfile;

}

Read more here:: About wordpress email attachment

Leave a Reply

Your email address will not be published. Required fields are marked *