[rt-users] Sending Mail With Attachments

Stephen Turner sturner at MIT.EDU
Wed Dec 15 16:07:22 EST 2004


Quoting Otmar Lendl <lendl at nic.at>:

> On 2004/12/15 15:12, Stephen Turner <sturner at MIT.EDU> wrote:
> > 
> > Hi,
> > 
> > I'm trying to set up a scrip that will send mail with a piece of text
> stored as
> > an attachment, and I'm not getting anywhere. Could anyone give me a hint?
> > 
> 
> I'm using a scrip with the default "Notify Requestors" Action combined 
> with a Template whose Content starts with
> 
> RT-Attach-Message: yes
> Subject: ....
> 

I guess I need more than a hint :)

What I'm trying to do is to have the queue-change action send mail to the
requestor - the mail needs to have some text (from a ticket CF) included as an
attachment.

Just adding "RT-Attach-Message: yes" at the top of the template doesn't work for
me - the queue-change transaction has no attachments, so no attachments are
added to the mail message (per Send_Email.pm).

I forced my template to create an attachment for the transaction to work around
the above problem, put this also didn't work because the Mime type is
plain/text and there's code in Send_Email.pm to prevent the attachment for this
mime type (I don't know why).

To solve that I created an attachment of type text/html - this finally had the
effect of adding an attachment to the mail message. But I'm left feeling that
it's an ugly solution and there must be a more elegant way. Plus I would really
like to send a text/plain attachment and am not sure why that is prevented by
the API.

If anyone can shed any light I'd be very grateful.

Thanks,
Steve







More information about the rt-users mailing list