Email Attachments

gesf

Active member
Hey 2nejunkie,

I think this is happening because you're not sending the file's mime type.
Try this out:

Code:
// Add this next line where you're "getting" the file data:
$attachment_type = $_FILES['attachment']['type'];
Code:
// Replace 
$message .= "Content-Type: application/octet-stream;\n\tname=\"" . $attachment_name . "\"\n"; 

// With:
$message .= "Content-Type: " . $attachment_type . "; name=\"" . $attachment_name . "\"\n";

Hope it helps ;)
 
Yes, it should be in that part of the code.
Example:
Code:
$attachment = $_FILES['attachment']['tmp_name'];
$attachment_name = $_FILES['attachment']['name'];
$attachment_type = $_FILES['attachment']['type'];
 
Back
Top