How to use mail,mailx command in Shell Script ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to use mail,mailx command in Shell Script ?
# 8  
Old 12-23-2005
Dear friend,

I have same problem

i want to send may to my yahoo account.

I have given following syntax in command prompt

mail -s "hello" xyz@yahoo.com

but the mail is not executing.

please help

regards
rajan
# 9  
Old 12-23-2005
Quote:
Originally Posted by rajan_ka1
D
but the mail is not executing.
any error message?
# 10  
Old 12-23-2005
no

but next command prompt is not coming
# 11  
Old 12-23-2005
try using -v option to look into more details
# mail -v -s "hello" xyz@yahoo.com
# 12  
Old 12-23-2005
same here.

If i exit ( ctrl + c) then it throws a message like this:

^Cmail: Mail saved in /svm_wl1/billing/work/svm_wl1/dead.letter

contents of dead.letter are:

From svm_wl1 Thu May 27 16:07 IST 2004
Content-Type:
Content-Length:




From svm_wl1 Tue May 31 12:54 IST 2005
From svm_wl1 Tue May 31 12:55 IST 2005
From svm_wl1 Tue May 31 14:51 IST 2005
From svm_wl1 Fri Dec 23 15:24 IST 2005
From svm_wl1 Fri Dec 23 16:22 IST 2005
From svm_wl1 Fri Dec 23 16:32 IST 2005


thats it...

i haven't got any mail for confirmation.

Regards
Abhijeet
# 13  
Old 12-23-2005
mail is not going to perticular recepient

regadrs
rajan
# 14  
Old 12-23-2005
Quote:
Originally Posted by rajan_ka1
no

but next command prompt is not coming
maybe u can try this:

# cat somefile | mail -s "hello" xyz@yahoo.com

i'm sure u'll get the prompt & make sure u can send email out from the machine. maybe u can look into mail log to see what went wrong.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s “Hello world” abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

2. Shell Programming and Scripting

Mailx command - send mail as table format

I have to send a couple of rows that have been returned from a SQL query. I have written the output of the query to a file and while i try to print this in the mail body the formatting goes wrong. Intended Output in mail body: Col1 Col2 Col3 ------ ... (2 Replies)
Discussion started by: qwertyu
2 Replies

3. UNIX for Dummies Questions & Answers

Mailx command in unix shell script, its throwing below error

How to use Mailx command in unix shell script, its throwing below error #!/bin/ksh let x=3 If ; then mailx -s “ $x is greater than 2” example@gmail.com << EOF This is the message body EOF fi its throwing error as syntax error at EOF... (10 Replies)
Discussion started by: only4satish
10 Replies

4. Shell Programming and Scripting

sending mail through mailx command

Hi I need help to send mail through mailx command . Currenlt my program is like #!/bin/ksh -x echo " " >> path.lst MAIL_LIST='someone1@gamil.com someone2@gamil.com someone3@gamil.com' cat path.lst | mailx -s "path loaction" $MAIL_LIST echo "End" exit 0 Its work fine . But i... (3 Replies)
Discussion started by: mani_isha
3 Replies

5. Shell Programming and Scripting

Carbon copy for a mail in mailx command

Hi, Can you please anyone say how to send a mail with carbon copy using the mailx command. i.e the recipient list should be in CC while the mail reaches them. I need the option mailx command Thanks in advance. (11 Replies)
Discussion started by: miltony
11 Replies

6. UNIX for Dummies Questions & Answers

Unable to send e-mail using mailx command

Hi All, Can you please help me in solving this. I am facing some problem sending mails. If I use like this, I am able to send mail the mail echo "This is an automated e-mail; please do not reply." | mailx -s "Good Morning ." 'abc@xys.com' But if I use like this, then I am unable to send... (1 Reply)
Discussion started by: manas6
1 Replies

7. UNIX for Dummies Questions & Answers

sending mail using mailx command

Hi All, Please help me regarding sending mails using mailx command in unix. I will be glad if some one give me the sintax of this. I tried using the below but vain. mailx -s 'Hi' 'xyz@abc.com' Regards, Manas (5 Replies)
Discussion started by: manas6
5 Replies

8. Shell Programming and Scripting

Problem with Mailx command to send mail with attachment

Hi, I am using mailx command to send a mail with attachment. It's working fine, but with attachment I am getting one extra attachment like (ATT00131.txt). I have tried to use unix2dos command also. But still I am getting the extra attachment. I am using the following code: subject="temp... (5 Replies)
Discussion started by: viswanatharv
5 Replies

9. Shell Programming and Scripting

how to know if the mailx command really sends the mail to the email address?

Hi guys, I have a question about the returning message of the mailx command. if I run a mailx command, how can I know if the email has been sent to the email address? If the email address doesn't exist, is there any error message returned? If yes, how can I get the error message? Thanks... (3 Replies)
Discussion started by: sheenshine
3 Replies

10. UNIX for Advanced & Expert Users

unable to sent mail in html format by mailx command.

I use maix command to sent mails. i can sent only plain text mails. Unable to sent mails in html format. while sending mails in html format, the received mail has the html code only. (17 Replies)
Discussion started by: p_prathaban
17 Replies
Login or Register to Ask a Question