04-25-2009
send attachments using send mail in Solaris
Hi All,
I have a requirement to send and email of body html with an attachment.
concatinating uuencode output to the mail body with mailx command works, but as my Email body is of HTML type i use sendmail.
my command to send HTML body is as below:
export MAILTO="recipient@domain.com"
export CONTENT="./html/body.html"
export SUBJECT="TEST EMAIL: TESTING HTML"
(
echo "From: noreply@domain.com"
echo "To: $MAILTO"
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Charset: iso-8859-1"
echo "Content-Disposition: inline"
cat $CONTENT
) | /usr/sbin/sendmail -t
With the above command I can send html body contents through send mail.
But, to the above scenario I need even the attachment.
Please help me out for this.
Thanks,
Mohan Kumar CS
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hai everyone
I want to send mail with attachments automatically
for every 15 minutes getting different E-mail IDs from a file
if any script is available , Please send to me ..
This will be very useful for my project....
Thanks for your time.....
Felix
... (3 Replies)
Discussion started by: Leo Felix
3 Replies
2. Solaris
Hello I am new user on solaris...
I need to configure my solaris to be able to send mails...
I know mailx command
mailx -s hello address@address.com
but I get an error...
you have mail in /var/mail/root
# hello... User unknown
/dead.letter... Saved message in /dead.letter
what... (10 Replies)
Discussion started by: amon
10 Replies
3. UNIX for Dummies Questions & Answers
Hi !!
I'm trying to send myself a mail from my Solaris server, i had tryed with this commands:
mail -s "test" irasela@yahoo.com < /monitoring/space/bitacora.txt
mailx -s "test" irasela@yahoo.com < /monitoring/space/bitacora.txt
sendmail -F "test" address "irasela.yahoo.com" -t... (1 Reply)
Discussion started by: irasela
1 Replies
4. AIX
Hi,
How can I send mail attachments from shell script (AIX) and have a mail body as well ?
Thanks in advance. (1 Reply)
Discussion started by: shibajighosh
1 Replies
5. Shell Programming and Scripting
hi experts,
I m new to the sun solaris.
on our OS (sun solaris 5.8) i m trying to send mail but i not getting any mail, i have tried doing following .
$mailx -s "Test" sivakumars@kesd.com
But no response there no error also...
pls let me know:
1) How can test sending mail through... (3 Replies)
Discussion started by: saisivakumar
3 Replies
6. Red Hat
We don't have uuencode installed in our machines..... Please tell me how to send mail with multiple attachments ??? URGENT !!!!!
Please tell me using command line (or) scripts..........
please......
Thanks in Advance.... (1 Reply)
Discussion started by: vamshigvk475
1 Replies
7. UNIX for Advanced & Expert Users
I am trying to send a mail alongwith attachments in hpux server. Its not throwing any error but it seems the command is still running,neither its sending the mail. The commands i am using is-
uuencode 00PZ00000012OHJMA2.csv | mailx -s "Hello" abc@hp.com
uuencode Shell_Script_Sample.ksh |... (1 Reply)
Discussion started by: saga20
1 Replies
8. Shell Programming and Scripting
I have Solaris-10 and some job is writing a log. My client needs this log file every two hour in his mail.
Usually I send manual mail through mailx command, as sendmail is configured with relay server, but I am not sure, how to attach file in a mail and set it in cronjob.
Please give me some... (3 Replies)
Discussion started by: solaris_1977
3 Replies
9. Shell Programming and Scripting
Hi,
i try to send two (multiple) files by the mail-console-command
mail -s TEST -a f1.pdf f2.pdf n.ame@ms123.de
but it doesn't work. can someone give me a hint?
Thanks in advance,
IMPe (2 Replies)
Discussion started by: IMPe
2 Replies
LEARN ABOUT REDHAT
mhmail
MHMAIL(1) [nmh-1.5] MHMAIL(1)
NAME
mhmail - send or read mail
SYNOPSIS
mhmail [addrs ...] [-body text] [-cc addrs ...] [-from addr] [-subject subject] [-version] [-help]
DESCRIPTION
mhmail is intended as a replacement for the standard Berkeley mail program (mail or mailx), which is compatible with nmh. This program is
intended for the use of programs such as cron, which expect to send mail automatically to various users. It is also used by various nmh
commands to mail various error notifications. Although mhmail can be used interactively, it is recommended that comp and send be used
instead to send messages.
When invoked without arguments, it simply invokes inc to incorporate new messages from the user's maildrop. When one or more users is
specified, a message is read from the standard input and spooled to a temporary file. mhmail then invokes post with the name of the tempo-
rary file as its argument to deliver the message to the specified user.
The -subject subject switch can be used to specify the "Subject:" field of the message.
By default, mhmail will read the message to be sent from the standard input. You can specify the text of the message at the command line
with the -body text switch. If the standard input has zero length, mhmail will not send the message. You can use the switch -body "" to
force an empty message.
Normally, addresses appearing as arguments are put in the "To:" field. If the -cc switch is used, all addresses following it are placed in
the "cc:" field.
By using -from addr, you can specify the "From:" header of the draft. Naturally, post will fill-in the "Sender:" header correctly.
FILES
/usr/bin/mh/inc Program to incorporate maildrop into folder
/usr/lib/mh/post Program to deliver a message
/tmp/mhmail* Temporary copy of message
SEE ALSO
inc(1), post(8)
DEFAULTS
None
CONTEXT
If inc is invoked, then inc's context changes occur.
MH.6.8 11 June 2012 MHMAIL(1)