Email Attachments

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Sun Aug 10, 2008 11:47 am

Hey 2nejunkie,

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

Code: Select all

// Add this next line where you're "getting" the file data:
$attachment_type = $_FILES['attachment']['type'];

Code: Select all

// 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 ;)
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Sun Aug 10, 2008 12:54 pm

Yes, it should be in that part of the code.
Example:

Code: Select all

$attachment = $_FILES['attachment']['tmp_name'];
$attachment_name = $_FILES['attachment']['name'];
$attachment_type = $_FILES['attachment']['type'];
Sincerely,
Gonçalo "gesf" Fontoura

gesf.org | sessionstart.com | urlms.com

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests