mime

Apache2 not sending "Content-Type" in header

Hello. I have a standard Apache2 installation on Ubuntu. I was trying to get mod_deflate to work, which it does, but noticed it was not gzipping my .js files. A closer inspection revealed that apache isn't sending Content-Type: for anything other than .php files. For them it's sending "text/html," which is strange since DefaultType i...

Detecting MIME type in PHP

I'm looking for the best (possible on most PHP 5.2 installs and still actively developed) way to detect a files MIME type in PHP. I'm aware of the mime_content_type() method and the Fileinfo extension, however mime_content_type() is unreliable and deprecated, and Fileinfo doesn't come in a "standard" PHP (5.2) install. Do I have any o...

What is the correct way to read a MIME encoded stream?

I have a TCP socket with streaming MIME messages on it. I can use the JavaMail API to parse one MIME message at a time by searching for the boundary, then looking for the boundary + -- symbol. This seems like a lot of String manipulation. Someone out there has to have done MIME-encoded streaming correctly in Java. Where is it hiding? ...

E-mails sent through php5+htmlMimeMail are being received with random characters replaced with =

Hi all, currently using PHP5 with htmlMimeMail 5 (http://www.phpguru.org/static/mime.mail.html) to send HTML e-mail communications. Have been having issues with a number of recipients seeing random characters replaced with equals signs e.g.: "Good mor=ing. Our school is sending our newsletter= and information through a company called......

ATTnnnnn.txt attachments when e-mail is received in Outlook

I've written an SMTP client that sends e-mails with attachments. Everything's fine except that when an e-mail sent by my program is received by Outlook it displays two attachments - the file actually sent and a file with two characters CR and LF inside and this file has name ATT?????.txt. I've done search - found a lot of matches like t...

parse mail to fetch attachments

Hi, how do I parse a mail in Cocoa? I've read the NSScanner tutorial, but struggled. Do you know any better way than NSScanner? Is there any sample code? My example: http://pastie.org/private/pordph27stkwkyvrx2tiq Regards ...

How do I get File Type Information based on extention? (not MIME) in c#

Hi. How do I get the general File type description based on extention like Explorer does it? So not MIME but the information that the end-user sees, like. .doc = Microsoft Office Word 97 - 2003 Document .zip = ZIP File .avi = Video File. And how can I get the 'secondary' information that seems to be available, which I guess it not ext...

What is .NET recommended practice to interact with MIME-emails with latest Windows OSes ?

We are using CDO interop (cdont.dll) in our current project for parsing incoming mime mails, but facing some bugs with Cyrillic code pages conversions. While looking for any MS supported replacements, we noticed that all available message parsing dlls marked with "Do not use" in MSDNLib (CDO, CDOex,CDOnt obviously, but inetcomm.dll for "...

.mp3 Filetype Upload

I'm working on a PHP upload script which allows .mp3 file uploads amongst others. I've created an array which specifies permitted filetypes, including mp3s, and set a maximum upload limit of 500MB: // define a constant for the maximum upload size define ('MAX_FILE_SIZE', 5120000); // create an array of permitted MIME types $permitted =...

Is my email header correct?

Hello all, Is the following "From" header incorect? // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: Mail Master <[email protected]>' . "\r\n"; if(sendEmailNow($email, $s...

SOAP with Attachment (SwA) in C#

Hi all, I need to use .NET in order to consume a JAVA written SOAP service which expects simple MIME attachments on some of its method. Does anybody know how to accomplish it? I could not find any information about using WCF or even WSE clients with such attachments. Thanks! ...

Replace an Expression Within Text Boundaries

I have a rather annoying issue that I solved using a simple recursive method in Java. However, I'm looking for a better way to do this. The initial problem involved the presence of whitespace within a Quoted Printable/Base64 encoded Mime header - which as I read the RFC 2047 specification - isn't allowed. This means that decoding fail...

Why doesn't this mail message decode correctly?

I have this code. It's from the Zend Reading Mail example. $message = $mail->getMessage(1); // output first text/plain part $foundPart = null; foreach (new RecursiveIteratorIterator($mail->getMessage(1)) as $part) { try { if (strtok($part->contentType, ';') == 'text/plain') { $foundPart = $part; brea...

How do I encode a binary MIME attachment in C#?

I need to send a binary attachment to a JAVA webservice via SwA (Soap with Attachments). After discovering that .Net does not support SwA I am writing my own client. How do I encode the binary MIME attachment, so that the Java service will be able to decode it? ...

Reading an mbox file in C#

Hi, One of our staff members has lost his mailbox but luckily has a dump of his email in mbox format. I need to somehow get all the messages inside the mbox file and squirt them into our tech support database (as its a custom tool there are no import tools available). I've found SharpMimeTools which breaks down a message but not allow ...

URN for MIME Type

Hi there, Does an official URN for the MIME type exist? Mozilla Firefox and other applications use notations like "urn:mimetype:text/plain" or "urn:mimetype:handler:text/plain". There are two problems with this approach: No "mimetype" namespace exists according to the IANA's official registry (http://www.iana.org/assignments/urn-name...

Python: Sending Multipart html emails which contain embedded images

I've been playing around with the email module in python but I want to be able to know how to embed images which are included in the html. So for example if the body is something like <img src="../path/image.png"></img> I would like to embed image.png into the email, and the src attribute should be replaced with a content-id. Does an...

Embedding attached images in HTML emails

If I attach an image to an email, how can I place it in the HTML content? I tried just using the filename as the image source but that doesn't seem to work. ...

How to handle long file names in javax.mail

I am new to using javax.mail API, version jdk 1.6.0.11. I am using javax.mail API to parse a MIMEMessage text and extract the attachments. If the MIME message contains attchments that have very long file names javax.mail API is not able to parse it and reports no attachments. I would appreciate any help on this. Thanks! ...

MIME Header - Content Disposition

Hello, I am trying to figure out if "Content-Disposition:attachment; filename=file_name" is required or not when file is sent as an attachment, and I am interested to persist it by the original name on a storage (drive). It looks like this is the only way to retrieve the original file name, but RFC is so muddy on it (link to RFC). It use...