JMail attachments not appearing correctly in Outlook
Posted on 2004-10-15
I'm trying to send a mail using JMail 4.4 and I'm having a big problem with Outlook. Internet mail clients do not show this behaviour.
The email is arriving at the destination, but the attachment is not 'attaching' correctly. The email in Outlook (2002 & XP) does not show the paperclip next to the mail icon to indicate there is an attachment, but if you select the file menu, then Save Attachments> you get a 'None' menu item (and not the correct filename), but if you select this you get the save as dialog with the correct file name, and the attachment is saved correctly.
I've tried all sorts of Content-Types to get the email to show up as having an attachment, but with little sucess.
The attachment is a very small zip file, although it doesn't matter what I attach, the results are the same.
If I specify the Content-Type of the JMail as "text/plain", "text/html", "multipart/mixed" I get no paperclip icon.
This is the code I'm using:
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.Logging = True
JMail.ServerAddress = "myhost.net"
JMail.Sender = "firstname.lastname@example.org"
JMail.SenderName = "ChrisB
JMail.Subject = "Code"
JMail.ISOEncodeHeaders = False
JMail.ContentType = "multipart/mixed"
JMail.Body = "Does it work?"
Set JMail = Nothing
If I wrongly specify the email Content-Type as "application/x-zip-compressed" (just to see what happens) I do get my paperclip icon, but I get two corrupt code.zip (not code1.zip) attachments. And these are corrupt as they have the first text email part with MIME header in the saved zip file.
I think I've tried every combination of content-types, both for the JMail.ContentType and the AddAttachment "code1.zip", Content-Type, and cant get this to work.
This is the raw content of an email sent with multipart/mixed for the email content type, and application/x-zip-compressed for the attachment, which doesnt show up as having an attachment in Outlook, but works fine in my internet browser mail (SmarterMail Pro 2.0)
Sender: "Chris Website" <email@example.com>
From: "Chris Website" <firstname.lastname@example.org>
Date: Fri, 15 Oct 2004 11:06:55 +0100
To: "email@example.com" <firstname.lastname@example.org>,
X-Mailer: JMail 4.4 by Dimac
This is a multipart message in MIME format.
Does it work=3F
Content-Type: application/x-zip-compressed; name="code1.zip"
Content-Disposition: attachment; filename="code1.zip"
I need to get this fixed asap as this is a component that will be serving my customers with files from the site, and getting this working in Outlook is a must!
Please help, I'm going Content-Type insane with all this.