Not able to send the mail using mail and mailx command | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

Not able to send the mail using mail and mailx command

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-21-2013
scriptscript scriptscript is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 30 January 2014, 11:03 AM EST
Posts: 74
Thanks: 21
Thanked 0 Times in 0 Posts
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.


Code:
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 < /usr/g/txt.log < /g/txt.log

I have veririfed sendmail using man. It exists.But dont know where went wrong.


Could you please let me know how to check the mail server is functioning or not on linux server.
Sponsored Links
    #2  
Old 01-21-2013
venikathir venikathir is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 19 May 2014, 12:10 PM EDT
Location: Bangalroe-India
Posts: 105
Thanks: 8
Thanked 5 Times in 5 Posts
Try this command

Code:
mail -s " Test" abc@xyz.com <press enter> 
<type some message> <Press Enter>
. <press enter to sent>
cc: <press enter>

Check this one is working
Sponsored Links
    #3  
Old 01-21-2013
MadeInGermany MadeInGermany is online now Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 28 July 2014, 4:13 AM EDT
Posts: 1,792
Thanks: 108
Thanked 510 Times in 463 Posts
Run a sendmail test:
sendmail -bv abc@xyz.com
Look at DSsmarthost in /etc/{mail/}sendmail.cf
The "smarthost" or "smtp gateway" is part of the SMTP infrastructure where you plug in; it can be a host or (better) an MX record.
An MX record can be looked up with
nslookup -q=mx xyz.com or
dig -t mx xyz.com
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mailx command - send mail as table format qwertyu Shell Programming and Scripting 2 11-29-2012 11:37 AM
Send mail using mailx to CC only, not TO unankix Shell Programming and Scripting 2 07-23-2012 12:07 PM
Unable to send e-mail using mailx command manas6 UNIX for Dummies Questions & Answers 1 01-22-2009 03:53 AM
Problem with Mailx command to send mail with attachment viswanatharv Shell Programming and Scripting 5 11-06-2008 01:10 PM
How to convert the data into excel sheet and send mail using 'mailx' command sanbabu Shell Programming and Scripting 5 10-14-2008 04:12 PM



All times are GMT -4. The time now is 04:18 AM.