cancel
Showing results for 
Search instead for 
Did you mean: 

Another attachment query

SOLVED
Go to solution
Graham_12
Occasional Visitor

Another attachment query

Just read the recent attachment query and am sending attachments quite happily with the following syntax...

uuencode test.xml test.xml | sendmail user@mail.com

However, if I then want to include some headers or body text by redirecting some input to sendmail, the attachments are no longer sent, e.g.

uuencode test.xml test.xml | sendmail user@mail.com
Many TIA
Graham
4 REPLIES
Rita C Workman
Honored Contributor

Re: Another attachment query

May I suggest using the include option...see if it better suits your needs.

See this thread:
http://my1.itrc.hp.com/cm/QuestionAnswer/0,,0x41950559ff7cd4118fef0090279cd0f9!0,00.html

Rgrds,
Rita
Stefan Farrelly
Honored Contributor
Solution

Re: Another attachment query

You need to build up an input file first before piping into sendmail. If you use uuencode ... | sendmail
You need to do it like this;
1. create a file with headers and body text.
2. uuencode >>
3. cat | sendmail
Im from Palmerston North, New Zealand, but somehow ended up in London...
Robin Wakefield
Honored Contributor

Re: Another attachment query

Hi Graham,

You can always try something like:

(echo Subject: This is a test

echo hello ;uuencode /tmp/s.pl /tmp/s.pl) | sendmail robin.wakefield@ubsw.com

Rgds, Robin.
Graham_12
Occasional Visitor

Re: Another attachment query

Stefan

Many thanks, that works.

I had a feeling it was something to do with the redirects rather than sendmail itself.

Regards
Graham