Sendmail to send attachements


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sendmail to send attachements
# 1  
Old 03-31-2014
Sendmail to send attachements

Hello All,

I have been trying to execute a script to send me alerts using a log file of a job which can be success or failed. But when I try to send log as attachment using sendmail it does not not send any email but job runs fine. I am not able to debug it. Please help to get the correct code.

thanks
Ross

Code:
 Alert job failed/complete
boundary='=== MESSAGE ==='
cat <<EOM | /usr/lib/sendmail -t
Subject: $job_status for $host 
To:${mail_list} 
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED
    BOUNDARY="${boundary}"
${alert}
--${boundary}
Content-Type: text/html;
This message was generated by ${0}
--${boundary}
Content-Type: text/plain;
Content-Displosition: attachement; filename=`basename $log`
`cat $log`
--${boundary}--
EOM

# 2  
Old 03-31-2014
I noticed few typo:
Code:
Content-Displosition: attachement; filename=`basename $log`

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Sendmail daemon is inactive, but still i can send emails

Hi, I did setup sendmail on one of AIX LPARs. Its working as expected. But, would like to clarify something with you all. I stopped the sendmail daemon on AIX LPAR, now it is inactive(&commented it on /etc/rc.tcpip ). But still, am able to send the emails even after stopping daemon. ... (6 Replies)
Discussion started by: system.engineer
6 Replies

2. Shell Programming and Scripting

Send attachment through sendmail

Hi, I am trying to send log file of a job run in unix machince through sendmail.Though I am able to send the text but it is not sending as attachment. Could you please look into the code and let me know where I have gone wrong fdate=`date %Y%j`... (2 Replies)
Discussion started by: Rossdba
2 Replies

3. AIX

Mail command to send attachements

I tried the below command uuencode data.txt | mailx -s “Test Mail” “mrp@xyz.com” But I get the below error ksh: uuencode: not found. Null Message body; hope that' ok which clearly tell that uuencode utility is not found. Is there any other way to send attachments with mail through... (7 Replies)
Discussion started by: rpm120
7 Replies

4. Solaris

Sendmail refuses to send via relay

Hi I have two realtively identical Solaris zones. They both appear to have the same config in relation to sendmail. But, when I send a test email using mailx the first one sends via a mail relay and the other sends via localhost. I need them both to use the relay but can't figure out what is... (0 Replies)
Discussion started by: gregb
0 Replies

5. UNIX for Dummies Questions & Answers

Send HTML graph using sendmail

Hi all. Urgent help required. I am trying to send and HTML/PNG fromat graph from UNIX using sendmail. The graph needs to be in the body of the HTML email and NOT an attachment.:wall: Any ideas and help will be really appreciated. Best regards, Willz (6 Replies)
Discussion started by: Willz
6 Replies

6. Debian

sendmail taking too much time to send a email

Hi , I'm using sendmail command to send a email. To send a email sendmail taking 3minutes to complete the process. Is there any configuration needs to be done in server or another solution is there to resolve this issue. Thanks in Advance. Regards Latika (1 Reply)
Discussion started by: latika
1 Replies

7. Shell Programming and Scripting

Send Attachements in Mail (CSHELL)

Hi All, Is there any way we can send attachement in a mail from the script using CSHELL. Thanks in Advance. (1 Reply)
Discussion started by: surfsg24
1 Replies

8. UNIX for Dummies Questions & Answers

Sendmail send wrong Name?!

Ok thats the Problem: I'm logged in as user "cypher" on my FreeBSD 4.7 and sendmail worked fine but wenn i try to send an EMail as "tobi@provider.org" the mail arrive as "cypher@provider.org". I configured Sendmail with genericstable "cypher tobi@provider.org" virtusertable ... (3 Replies)
Discussion started by: Cyvver
3 Replies

9. Cybersecurity

Sendmail keep a user from send message

Hello, i have a problem with my sendmail, i want' to keep a user from sending mail, how can i process ? My user is titi, and i don't want' that titi can't send mail via sendmail is it possible ? thnak a lot (1 Reply)
Discussion started by: westside
1 Replies
Login or Register to Ask a Question