Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Not able to send the mail using mail and mailx command

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 01-21-2013
scriptscript scriptscript is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 16 November 2014, 9:00 AM EST
Posts: 75
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 Unix and Linux 01-21-2013
venikathir venikathir is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 30 June 2015, 12:58 PM EDT
Location: Bangalroe-India
Posts: 106
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 Unix and Linux 01-21-2013
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 3 July 2015, 1:49 PM EDT
Location: Simplicity
Posts: 2,493
Thanks: 184
Thanked 754 Times in 682 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 11:23 PM.