The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-08-2008
samuelc samuelc is offline
Registered User
  
 

Join Date: May 2007
Posts: 2
Arrow Send email with attachement-Getting connection refused by domain

Hi all,
I am a newbie to unix.
I need to send an email with an attachment in unix to some id like abc@some_company.com

Code i have used is


------------Code---------------------------
#!/bin/ksh
set -x
#set -n
#cript: unix_mail_withattachments.ksh
# Aurthor: Ravin Maharaj
# Purpose: Use sendmail to e-mail messages from Unix with
# file attachements
# --------------------------------------------------------------------

SUBJ="Send mail from Unix with file attachments"
TO=a@some-company.com
CC=b@some-company.com
(
cat << !
To : ${TO}
Subject : ${SUBJ}
Cc : ${CC}
!

cat << !
HOPE THIS WORKS
This sample E-mail message demonstrates how one can attach
files when sending messages with the Unix sendmail utility.
!

uuencode ${file_1} ${file_1}


) | sendmail -v ${TO} ${CC}

------------Code---------------------------

After which I run "mutt command I get message like "Connection refused by say some_company.com".

What needs to be done?
Any help will be great.

Last edited by samuelc; 02-08-2008 at 02:38 AM..