Hi,
I am trying to use the nsIMsgAttachment interface to add an attachment to an
email message.
Problem is that I can't find a way to set the Content-type to have
parameters, like: "Content-Type: text/calendar; method=REQUEST"
Looking at the code it seems that this is stripped.
Is this a bug, or is there a special reason to disallow setting an
attribute? any work-around for this, maybe there is another interface I
could use or hack up the message directly?
Also, is it possible to set the content type of the main message, when not
using text or html?
ArentJan
Code in nsMsgAttachment.cpp:
NS_IMETHODIMP nsMsgAttachment::SetContentType(const char * aContentType)
{
mContentType = aContentType;
/* a full content type could also contains parameters but we need to
keep only the content type alone. Therefore we need to cleanup it.
*/
PRInt32 offset = mContentType.FindChar(';');
if (offset >= 0)
mContentType.Truncate(offset);
return NS_OK;
}