Send email with attachement-Getting connection refused by domain


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Send email with attachement-Getting connection refused by domain
# 1  
Old 02-08-2008
CPU & Memory 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..
# 2  
Old 02-08-2008
Tools Something to try?

uuencode file.txt file.txt | mailx -s "subject" samuel@company.com
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Send file attachement in mail

Hello, I am able to attache the file in UNIX/LINUX script using following code. MAILFORMAT="Please do not replay this mail.This mail is auto generated." echo -e $MAILFORMAT | mailx -r autoreplay@gmail.com -a filename -s "status" xyz@gmail.com But same I am not able attache... (6 Replies)
Discussion started by: nes
6 Replies

2. Red Hat

Not able to send an email from a particular domain.

HI Gurus, I have a RHEL (5.5) VM. I am able to send email to a particular domain abc.com but when I am trying to send a different domain(xyz.com) it is not working can you please throw some light on how to start debugging this issue. Thanks in advance. RK (0 Replies)
Discussion started by: rama krishna
0 Replies

3. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

4. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

5. Shell Programming and Scripting

How to send a mail with attachement as well as message Body..?

Hi all, i am working with CSH, i want to know that how to send a mail in UNIX shell script (CSH) with attachment as well as message body. i know that how to send a mail with attachment and message body. but i want know both things in a single mail Suggession would be appreciate. ... (1 Reply)
Discussion started by: psiva_arul
1 Replies

6. IP Networking

Connection refused

Hi there, Anything will help. I have running server on computer and want to connect from some clients. Server: memset(&hints, 0, sizeof(hints)); hints.ai_family = domain; hints.ai_socktype = SOCK_STREAM; error = getaddrinfo("localhost", "8300", &hints, &res0); if (error) { ... (1 Reply)
Discussion started by: Dudu1984
1 Replies

7. Shell Programming and Scripting

How to send Mail with Attachement

Hi Can somebody help me in wirting shell script in the following way.Desperately i have poseted this.. 1.How can I connect to Oracle(Sqlplus) from UNIX. 2.After connecting to it I have to execute an oracle proceudure.. 3.Execution of the procedure will give some set of rows.. 4.The set of... (6 Replies)
Discussion started by: chgopi
6 Replies

8. UNIX for Dummies Questions & Answers

Send a mail with an attachement of a file

I wanted to try sending a mail with an attachement at command prompt in unix. Some one please advise that how we can do it ? Thanks, :) (2 Replies)
Discussion started by: gaddeg
2 Replies

9. UNIX for Dummies Questions & Answers

Send a mail with a subject and an attachement

Dear All: I want to send a message to a list of people with a subject and an attachement, currently I am using the following command into a shell script: uuencode $FILENAME.gz $FILENAME.gz | mail john.kennedy@mycompany.com m.m@mycompany.com With this command I can send the message for a... (1 Reply)
Discussion started by: josecollantes
1 Replies
Login or Register to Ask a Question