Not able to receive mail using mail command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Not able to receive mail using mail command
# 1  
Old 09-09-2009
Not able to receive mail using mail command

Hi all,
I have written a script which supposed send a mail.
For testing I am just sending mails to my ID.
script I have written to send mail is-

Code:
#!/usr/bin/ksh
MAIL_FILE="$HOME/MAIL_FILE"
MAILOUT_LIST="milindb@example.com"
mail -s "Subject" $MAILOUT_LIST < $MAIL_FILE
 
if [ "$?" -eq 0 ]
then
echo "Mail sent succesfuly"
else
echo "Sending mail failed"
fi


after running this script on ksh I am getting message as "Mail sent succesfully" but I am not receiving any mails in my inbox.
Please help me to find out solution for this.

Regards
Milind
# 2  
Old 09-09-2009
I don't think there is any problem in your script. May be there is some problem in your mail server.
Please check from your command prompt if mail command is working or not,
mail -s "Subject" abc@def.com
If you receive the mail, then from the script also u will get the mail.
# 3  
Old 09-09-2009
I tried the command option also it didn't worked..sorry
How can I check mail server configuration ?
Whether I have access to send mails?

Thanks
# 4  
Old 09-09-2009
I tried the command line option also it didn't worked..sorry
How can I check mail server configuration ?
Whether I have access to send mails?

Thanks
# 5  
Old 09-09-2009
Please post the name and version of your Operating System and state whether you are the administrator of the computer and have "root" access.
Please state whether the target email address is on your server or somewhere else. There is quite a difference between mailing within the computer and mailing the outside world.
# 6  
Old 09-10-2009
Thanks methyl for u r reply.
I am using SunOS 5.10 . I am not a administrator & I dont have root access as well.
Mailing address is on different server, actually I am trying to send an email to my outlook inbox.

Regards
Milind
# 7  
Old 09-10-2009
I think you need to speak to your server administrator.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Don't receive confirmation mail.

Hi Folks, I just recently registered with the username _Kaede. Unfortunately, I didn't receive any confirmation mail also not when I changed to another address. Help is very appreciated. Thanks and kind regards :) (2 Replies)
Discussion started by: Unregistered
2 Replies

3. Web Development

Gmail very slow to receive Sendmail/PHP Mail

Okay, I have searched the forums and couldn't really find a topic on this, so I decided to start one. But I decided to start a ncurses discussion forum recently and one thing I noticed while getting it going is that when mail is sent out via Sendmail or PHP Mail, Gmail is /very/ slow to receive it.... (2 Replies)
Discussion started by: Phobos D'thorga
2 Replies

4. Homework & Coursework Questions

Creating a function that sends a mail using mail command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The function will be called m and it will allow you to send an email to someone using the mail command. The... (1 Reply)
Discussion started by: Drucian
1 Replies

5. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. Shell Programming and Scripting

I could not receive the mail sent from the unix server using 'mailx'

Hi All, I have sent a mail to my gmail id using the below command. echo " " | mailx -s "sub" myid@gmail.com I didn't get any error notification. But still I didn't receive that mail still.. please help me to learn how to send mail to other provider (Yahoo/gmail) from unix server.... (1 Reply)
Discussion started by: little_wonder
1 Replies

7. UNIX for Dummies Questions & Answers

I can send but cannot receive mail with unix?

Hi all, First post! I have just discovered that I can use unix to send mail to a mail address. I normally use entourage for my mail. This unix mail is very intriguing to me, but something is not working... I tried the search, but could not find the answer... This works: (in terminal)... (1 Reply)
Discussion started by: bjorn
1 Replies

8. UNIX for Dummies Questions & Answers

Receive e-mail on unix box

Hi, I am not sure if it is a good question or not. Is there a unix utility which can be configured with exchange server and then receive e-mails? Thanks! (4 Replies)
Discussion started by: DejaVu
4 Replies

9. Forum Support Area for Unregistered Users & Account Problems

Did not receive activation mail

Hi Administrators, I've registered myself yesterday and have been waiting for my account to be activated. I've followed the instructions in the 'See this if you have an account but cannot post ' thread to request for an activation mail to be sent to my other email address, but still did not... (0 Replies)
Discussion started by: pl_cyber
0 Replies
Login or Register to Ask a Question