Solved

JMail attachments not appearing correctly in Outlook

Posted on 2004-10-15
17
2,395 Views
Last Modified: 2012-05-05
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 = "chris@nospam.com"
JMail.SenderName = "ChrisB
JMail.Subject = "Code"
JMail.AddRecipient "chris@nospam.com"
JMail.ISOEncodeHeaders = False
JMail.ContentType = "multipart/mixed"
JMail.Body = "Does it work?"
JMail.AddAttachment Server.MapPath("code1.zip")
JMail.Execute
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)

...HEADERS...
Subject: Code
Sender: "Chris Website" <chrisweb@nospam.com>
From: "Chris Website" <chrisweb@nospam.com>
Date: Fri, 15 Oct 2004 11:06:55 +0100
To: "chris@nospam.com" <chris@nospam.com>,
"chris@nospam.com" <chris@nospam.com>
X-Priority: 3
X-MSMail-Priority: Normal
MIME-Version: 1.0
X-Mailer: JMail 4.4 by Dimac
Content-Type: multipart/mixed;
boundary="--NEXT_BM_47AF7764AA5E46A99C4311D7F3057119"
Message-Id: <20041015100655.C623C214BB9@mxhost-1.vi.net>
Virtual_Internet-SpamScore: s
Virtual_Internet-From: chris@nospam.com

This is a multipart message in MIME format.
----NEXT_BM_47AF7764AA5E46A99C4311D7F3057119
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: Quoted-Printable

Does it work=3F

----NEXT_BM_47AF7764AA5E46A99C4311D7F3057119
Content-Type: application/x-zip-compressed; name="code1.zip"
Content-Transfer-Encoding: base64
Content-Description: code1.zip
Content-Disposition: attachment; filename="code1.zip"
Content-ID: <8E242FFFAA4F4F43B6A73C1EDFA84822>

UEsDBBQAAAAIALFsSzEctpM4rwIAACYGAAAIAAAAY29kZS50eHS9VG1v2jAQ
..ETC...
toEAAAAAY29kZS50eHRQSwUGAAAAAAEAAQA2AAAA1QIAAAAA


----NEXT_BM_47AF7764AA5E46A99C4311D7F3057119--


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.

Cheers,
Chris.
0
Comment
Question by:FalconUK
  • 6
  • 6
  • 2
17 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12317547
what happens if you dont specify he contenttype ie
<%
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.Logging = True
JMail.ServerAddress = "myhost.net"
JMail.Sender = "chris@nospam.com"
JMail.SenderName = "ChrisB
JMail.Subject = "Code"
JMail.AddRecipient "chris@nospam.com"
JMail.ISOEncodeHeaders = False
JMail.Body = "Does it work?"
JMail.AddAttachment Server.MapPath("code1.zip")
JMail.Execute
Set JMail = Nothing
%>
0
 

Author Comment

by:FalconUK
ID: 12317581
I get no paper clip, but I can save the file correctly by File > Save Attachments > None.
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 12317619
i dont have Jamil4,4 with me but i think there is a property called as
NoAutoContentID which needs to be set to true. The attchment not appearing in outlook was an older version problem(4.3) which they'd claimed was solved in 4.4 build.
0
 

Author Comment

by:FalconUK
ID: 12317682
That sounds like what I need but apparently I dont have that method, even though JMail.Version shows 4.4???

Can I add this header myself to the mail object?
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12317708
Nope not unlesss you have the proper version.4.4
Right click on the jmail dll and view the version iyou've.
0
 
LVL 26

Expert Comment

by:Hilaire
ID: 12318268
Listening ...
Got the same problem, couldn't find a way to solve it for the moment.
Any solution gets 500 more points from me ...
0
 

Author Comment

by:FalconUK
ID: 12318400
Just logged a support call with my ISP to upgrade the JMail component to the lastest version.

I'm waiting to hear back from them...fingers crossed!

Interesting enough, MS seam to be aware of this problem...
http://support.microsoft.com/kb/313316/EN-US/
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 33

Expert Comment

by:sajuks
ID: 12318406
They claim v4.4 has solved the above problem.

From the dimac website http://www.dimac.net/
----------------------------------------------------------------------------------------------------------------------------------------
Q: When I attach files to my HTML mails, the attached files just look like this:

This is a multipart message in MIME format. ----NEXT_BM_2D86444211634CEF8F266D5AC452437C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: Quoted-Printable body text ----NEXT_BM_2D86444211634CEF8F266D5AC452437C Content-Type: application/octet-stream; name="=?iso-8859-1?Q?help=2Egif?=" Content-Transfer-Encoding: base64 Content-Description: =?iso-8859-1?Q?help=2Egif?= Content-Disposition: attachment; filename="=?iso-8859-1?Q?help=2Egif?=" Content-ID: R0lGODlhEAAQAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8EBC SkFETEJFTUNGTUVIT0lMVExOWFJWX1peaFteaV1hbGFlb2RqdmhseAAwvQtF uAxFuw1IvRBHuRVMtyRWuTxkuQ9KwQ9KxBBLwRNOxhtTwxpTxx9VxB5WxRlU yRRT0SNYwCFYySNayiNbyyBazSFazCJbzSZcyitewylexildySheyihfyyle...

A: Try removing this line:
    JMail.ContentType = "text/html"

and just use:
    JMail.Body = "..." (for the plain text version)
    JMail.HTMLBody = "..." (for the html version)


----------------------------------------------------------------------------------------------------------------------------------------
 New in v 4.4:

- Some issues regarding incorrect handling of attachments in
 POP3 were fixed.

- An issue which sometimes generated an error when iterating
 multiple attachments were fixed.

- The property "NoAutoContentID" was added to the message object. If set to true, no Content-ID header will be generated for regular attachments. For inline attachments, the header is still set. This can be used to solve some attachment problems occuring with certain email-clients. The default value is false.

0
 
LVL 26

Expert Comment

by:Hilaire
ID: 12348659
FYI
I upgraded to 4.4 and tried NoAutoContentID = true

Still getting a "None" in the Save Attachments menu :-(
0
 

Author Comment

by:FalconUK
ID: 12348781
Just had an email from my ISP.

They are not prepared to upgrade the JMail component anyway.

Security issues, compatibility issues, effects on other customers and licencing were their reasons.

Does anyone have any other ideas on this one?
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12348815
Try some other mail client dll like funcky or aspemail ?
0
 

Author Comment

by:FalconUK
ID: 12545050
This was my web site hosts reply:

Your welcome to try other mailing scripts that can be downloaded on the Internet and uploaded to your website, however we can't give you any assistance if you have trouble configuring the script nor can we guarantee this will work on our servers.

So can anyone recomend something they use them selves, something easy to setup?
I'm guessing that I need something different than products like JMail, as this needs to be installed my hosts servers, and this isnt going to happen.
Are there any scripts out there that I can use that dont require me to install anything on their server?

All I want to do is send emails with attachements!

Chris.
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12550913
What server side scripting language do they support ? if you use php or cgi for example there are lots of mail classes that you could use for your requirement
0
 

Author Comment

by:FalconUK
ID: 12752722
I'm sure that sajuks second answer would of worked, but I have no way of testing this.

So I am no longer sending emails with attachments.

I didn't want to accept this answer without testing it, although I'm sure it true as I have read on a few more web sites about it.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now