Showing results for 
Search instead for 
Did you mean: 

Sendmail : How can I set the "Subject:" ?

Go to solution
Occasional Advisor

Sendmail : How can I set the "Subject:" ?

Hello everybody,

I am using sendmail and reach many problems :
1. Is it possible to set the "SUBJECT:" clause of a mail, when using sendmail ?
2. Mails which had correctly been sent & received (on Exchange) don't show the "To:" clause (the receiver himself...). Can it be shown ?
3. About one year ago I configured automatic emails via cron which needed to attached files(UX 10.20). At this time the only way was to use uuencode + elm (sendmail made troubles with the attachement...). Is it now possible the attach file with sendmail (UX 10.20 or 11.XX) ???

P.S. : If all thoses problems can be solved by another command that sendmail, I would use it ...
Robin Wakefield
Honored Contributor

Re: Sendmail : How can I set the "Subject:" ?



(echo "Subject: hello

this is the hosts file";cat /etc/hosts) | sendmail

will set the subject to hello. If the first line starts with "Subject:" & is followed by an empty line, this triggers it to be the Subject.

3. uuencode still required with sendmail:

uuencode /tmp/1 /tmp/1.txt | sendmail

Rgds, Robin.
Rita C Workman
Honored Contributor

Re: Sendmail : How can I set the "Subject:" ?

Have you tried:

elm -s "My subject for today $(date)" < /home/me/include_command_for_attached_file

Just because I like the include statement that sendmail will use...See this thread:,,0x41950559ff7cd4118fef0090279cd0f9!0,00.html

I'm not positive about it possible it's on the Exchange side that is blocking out the To:..?

Paula J Frazer-Campbell
Honored Contributor

Re: Sendmail : How can I set the "Subject:" ?


mailx -s "Subject"
If you can spell SysAdmin then you is one - anon
Honored Contributor

Re: Sendmail : How can I set the "Subject:" ?

You can also try this.
# sendmail user@hostname {return}
Subject: This the subject {return} ( You need to write Subject and name of subject in this manner)

Write down here the message {return}
. {return}

Good Luck..