Hi all;
I need to send an email message from Mediator which will get picked up by GoldMine contact management software to update contact info. To do this, the content-type of the email must be set to ‘application/x-gm-impdata’. the actual data is simple text key/value pairs.
I have tried setting the xbd.outbound.alternate.content.type property, with the obvious result that Mediator spits the following error:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/x-gm-impdata
All I could think of was to change the mimetypes.default and mailcap.default in the activation.jar that comes with Mediator. My environment is win2k, java 1.4.1_02 and tomcat 4127; I can see under tomcat’s work directory that the activation.jar does indeed have the modifications I added, however the result is the same.
any ideas??
regards,
- arp
Hi Arp,
This error is part of a rather obscure behavior of the Java mail library. It actually requires a specific class to be defined for each content-type that you want to send as a mail body. We had to add some additional code to map application/xml and text/xhtml to the existing class for text/xml.
According to the javadoc, there are some mechanisms for adding this information via an external file, but I have never tried. I will look into this possibility, but I can’t promise a quick solution.
Best regards,
Mike
Hi Arp,
I think I have a circumvention, albeit a bit strange. The problem is how it associate a content handler class with your particular content type. This is done using something called a mailcap file (you can find more information in the Java doc for the Java Activation Framework if you are interested).
Anyway, create a small text file containing the following text (all on one line):
application/x-gm-impdata;;x-java-content-handler=com.sun.mail.handlers.text_plain
Save this in a file named “.mailcap” - no file extension, starts with a ‘.’ - and put the file in the directory identified by the java “user.home” system property. You can find this directory by using SMH to display the system information from a running factory. One of the java system properties listed should be “user.home”. (On my XP system, this was C:\Documents and Settings<userid>.)
I will look into a mechanism for doing this using properties to the SagMailGateway for a future release.
Best regards,
Mike
Yup, that did the trick. Seems that the mailcap in the activation.jar is not used.
One small detail in case anyone else needs it - the SMH user (and thus user.home) are not necessarily the same as the user for the component factory.
thanks again mike!
- arp