The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passing global variable to a function which is called by another function sars Shell Programming and Scripting 4 06-30-2008 08:39 AM
Function within function (Recurance) chassis UNIX for Dummies Questions & Answers 2 09-19-2006 06:32 AM
sendmail kara UNIX for Dummies Questions & Answers 1 03-15-2002 03:28 PM
Sendmail htsubamoto UNIX for Dummies Questions & Answers 1 02-05-2002 02:01 PM
How to convert the "select" function into a "poll" function rbolante High Level Programming 1 07-10-2001 07:49 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-02-2006
Registered User
 

Join Date: Aug 2005
Posts: 18
sendmail function

Hi all,

Following is the code for sending mail with attachment

#! /bin/ksh

SUBJ="Send mail from Unix PHDCAP12 "
TO=tmp@rediff.com
CC=tmp1@rediff.com
(
cat << !
To : ${TO}
Subject : ${SUBJ}
Cc : ${CC}
!

cat << !
HOPE THIS WORKS Test123
This sample E-mail message with the Unix sendmail utility.
!

#uuencode ${1} ${1}
!

) | /usr/lib/sendmail -v ${TO} ${CC}


====
here even after changing the to and cc adresses the mail is still going to the same address mentioned for the first time.Can nyone help
Reply With Quote
Forum Sponsor
  #2  
Old 05-02-2006
Registered User
 

Join Date: Feb 2006
Location: California
Posts: 45
I normally create the Header ( From, To, Cc, Sub) and then use sendmail -t option to send it.. then I do not need to specify the recepients to sendmail.. sendmail reads the message for recepients and sends it across..
Code:
(
cat << !
FROM : $FROM
To : $TO
Subject : ${SUB}
Cc : ${CC}
!

cat << !
HOPE THIS WORKS Test123
This sample E-mail message with the Unix sendmail utility.
!

#uuencode ${1} ${1}
!

) | /usr/lib/sendmail -vt
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0