Sponsored Content
Top Forums Shell Programming and Scripting need help with my sendmail script Post 302485043 by adshocker on Tuesday 4th of January 2011 04:22:20 AM
Old 01-04-2011
need help with my sendmail script

hi all,

i'm trying to use sendmail to send a message in html format with attachments but having some issues with the attachments. below is my code.

Code:
ATTACH1="/export/home/adshocker/attach.prog"
ATTACH_NAME1=${ATTACH1##*/}
echo "ATTACH_NAME1=$ATTACH_NAME1"
ATTACH2="/export/home/adshocker/attach.sh"
ATTACH_NAME2=${ATTACH2##*/}
echo "ATTACH_NAME2=$ATTACH_NAME2"
(
 echo "To: $MAILTO"
 echo "Subject: $SUBJECT"
 echo "MIME-Version: 1.0"
 echo 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"'
 echo
 echo '---q1w2e3r4t5'
 echo "Content-Type: text/html"
 echo "Content-Disposition: inline"
 cat $BODY
 echo '---q1w2e3r4t5'
 echo 'Content-Type: application; name="'${ATTACH_NAME1}'"'
 echo "Content-Transfer-Encoding: base64"
 echo 'Content-Disposition: attachment; filename="'${ATTACH_NAME1}'"'
 uuencode $ATTACH1 $ATTACH1
 echo 'Content-Type: application; name="'${ATTACH_NAME2}'"'
 echo "Content-Transfer-Encoding: base64"
 echo 'Content-Disposition: attachment; filename="'${ATTACH_NAME2}'"'
 uuencode $ATTACH2 $ATTACH2
 echo '---q1w2e3r4t5--'
) | /usr/sbin/sendmail $MAILTO

when i get the message, i only get the first attachment and when i open it, it's sort of encrypted. can anyone help me with this.

i'm using solaris.

thanks.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sendmail in script.

SCO UnixWare 711 ksh Hi Friends. I am using sendmail. I can issue a sendmail request via the prompt but the same request will not work though a script it hangs after the first line of sendmail - can someone plese help. Below is what hangs: From Script: $NUMBER has been... (5 Replies)
Discussion started by: sureshy
5 Replies

2. UNIX for Dummies Questions & Answers

Issues with cronjob : Script using sendmail

Hi All, I am new to unix. I have created a cron job, that sends mail using sendmail utility. Am facing a unique problem while making a cron job for this script. In the script I append a file to my mail using 'cat' command. cat $report >> $mailMsg & this $mailMsg is used as mail... (7 Replies)
Discussion started by: anshulporwal
7 Replies

3. Shell Programming and Scripting

Using sendmail utility in K Shell script

Hi, I am new to shell scripting and thus any help will be highly appreciated. I need to write a K shell script where in the email sending feature should be handled by sendmail utility and I have come up with the following : #!/usr/bin/ksh echo "This is a test mailest mail" | /usr/lib/sendmail... (4 Replies)
Discussion started by: sdiptanil
4 Replies

4. Shell Programming and Scripting

Sendmail works from script, but not when called from Apache

Hi, I am building a web interface to run a series of shell scripts that reside on the web server. The bash script are written such that they can be used independently for the task they are meant for, or the same scripts can be run from this web UI. The scripts are mostly for doing software... (1 Reply)
Discussion started by: MacQAGuy
1 Replies

5. UNIX for Advanced & Expert Users

Sendmail Script don't deliver mails

Hi, i've got a problem with a sendmail script, which sends HTML mails. Some mail will rejected by the mail server, because the fqdn doesn't exist. Where can i set the sender-domainname by sendmail? My mail server say: "Sender address rejected: Domain not found;", which is correct... (3 Replies)
Discussion started by: rainbowwarrior
3 Replies

6. Shell Programming and Scripting

Help with integrating shell script with sendmail

Hi friends, I want to converting a task ,of making few words in my task mail bold and underlined sometimes, automated through sendmail. I have never used sendmail/mailx before. What i want is my ouput which looks like below: +++++++++++++++ DETAILS: sqlid:6mbiosdfsdff parsing_schema_name:... (1 Reply)
Discussion started by: kunwar
1 Replies

7. Shell Programming and Scripting

Sendmail script not working

I am facing a peculiar problem in AIX 6.1 I can execute sendmail command using the following script sendmail -f sender -v recepient Body of email ^dThe command executes successfully and mail is sent to the intended recepient but when I try to use the attached script, the mail is not sent... (3 Replies)
Discussion started by: abhilashnair
3 Replies

8. Solaris

Clarifying sendmail configuration - sendmail-client offline

Hi all, I have read about sendmail running as 2 separate process. 1 as a MSP, and the other as the real daemon or MTA. In my current configuration, the sendmail-client is disabled. Both submit.cf and sendmail.cf are left as default untouch I do not specified any mailhost... (3 Replies)
Discussion started by: javanoob
3 Replies

9. Shell Programming and Scripting

Python script for sendmail limitation

Hello, I have a web server (apache, php-fpm) with several vhosts sending mail through php. In order to avoid IP blacklisting when spam is sent by a domain i'm looking for a way to setup a rate limit for outgoing mail and when this limit is reached I want to receive an email warning me that a... (1 Reply)
Discussion started by: draugr
1 Replies

10. Shell Programming and Scripting

Script to connect to remote and sendmail.

Hello, Kindly guide. SendMail function on my script is not working, but it works manually. Any better way to handle the script is appreciable. #!/bin/sh GetHostConnection() { truncate --size 0 /home/web/for_mail.out while read -r lines ; do ip=`echo $lines | awk '{print... (9 Replies)
Discussion started by: sadique.manzar
9 Replies
SIMPLIFY(1)						      General Commands Manual						       SIMPLIFY(1)

NAME
simplify - a script to simplify a MIME message SYNOPSIS
simplify [args ...] < message > othermessage DESCRIPTION
This manual page documents briefly the simplify command. simplify is a Perl script to simplify a MIME message. This script never loads the entire message into memory, but does dump it's entire contents to disk once. OPTIONS
mime=no Don't use MIME, no HTML mail allowed. testing=yes Run in testing mode (suppress randonmess) saveall=yes Save all attachments to files. temp=/path/to/working/dir/ Defaults to /tmp. url=http://box/path/ URL-prefix for printing paths to attachments header=text... Text preceding the attachment URL list. textsig=/path/to/file Text signature to append to text parts. htmlsig=/path/to/file HTML signature to append to HTML parts. If "saveall" is yes, then the script will save all attachments to disk so people can access their contents later. If an URL is specified then that automatically implies "saveall=yes". Without this, the default behavior is to only save text and html parts, and delete them and all working directories when the script is finished. SEE ALSO
sanitizer(1). More info on configuration: /usr/share/doc/sanitizer/sanitizer.html AUTHOR
Bjarni R. Einarsson <bre@klaki.net> This manual page was written by Alberto Gonzalez Iniesta <agi@agi.as> for the Debian GNU/Linux system (but may be used by others). May 14, 2003 SIMPLIFY(1)
All times are GMT -4. The time now is 06:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy