kamaxo Posted December 29, 2010 Share Posted December 29, 2010 hi there. this is my first post. i'm sory for my english (i'm portuguese) i have i very bad situation. on my code. i'm sending an email from my aplication and when arrives to the client the Attachments is send with the extension ".dat". in my pc the email is sent correct. but from other pc (server) the extension arrives ".dat". does anyone have the same problem ??? please help me. tnks Quote Link to comment https://forums.phpfreaks.com/topic/222897-email-attachments-dat/ Share on other sites More sharing options...
trq Posted December 29, 2010 Share Posted December 29, 2010 We can't help people without see relevant code. Quote Link to comment https://forums.phpfreaks.com/topic/222897-email-attachments-dat/#findComment-1152522 Share on other sites More sharing options...
kamaxo Posted December 29, 2010 Author Share Posted December 29, 2010 This is my code. include("Mail.php"); include("Mail/mime.php"); $text = ""; $html = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' /> <title></title> <style type='text/css'> #footer {0 0 repeat-x ; width:90%; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; font-size:10px; text-transform:uppercase; padding:2px; } </style> </head> <body> <div align='center'> $msg </div> </body> </html>"; $crlf = "\r\n"; $hdrs = array( "From" => $emailempresaprincipal->email, "Subject" => $subj , "To" => "$to", "Cc" => "$cc_", "Bcc" => "bcc_" ); $mime = new Mail_mime($crlf); if ($ficheiro_){ foreach($_FILES['ficheiro_']['name'] as $key => $name) { $tipo = substr($_FILES['ficheiro_']['type'][$key], 0, 5); $dirmail = "c:/wamp/www/portal/documentacao/"; $dir = '../documentacao/'; $nomedocumento_ = date("Ymd") . date("His") . "-"; ficheiros ="$dir". $_FILES['ficheiro_']['name'][$key]; $mime->addAttachment($dirmail . $nomedocumento_ . $_FILES['ficheiro_']['name'][$key]); } $mime->setTXTBody($text); $mime->setHTMLBody($html); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $recipients = $to.", ".$cc . ", ". $bcc_; $mail =& Mail::factory("smtp"); $mail->send($recipients , $hdrs, $body); Quote Link to comment https://forums.phpfreaks.com/topic/222897-email-attachments-dat/#findComment-1152574 Share on other sites More sharing options...
kamaxo Posted January 3, 2011 Author Share Posted January 3, 2011 anyone ??? Quote Link to comment https://forums.phpfreaks.com/topic/222897-email-attachments-dat/#findComment-1154116 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.