Mail sending


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mail sending
# 1  
Old 09-18-2007
Question Mail sending

Dear all,
how can i send mail using mailx or mail command?do i need to configure anything for sending mail?please help me.Its urgent.
the version i use is
Linux TDM 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linux

Thanks
Regards,
Pankaj
# 2  
Old 09-18-2007
Lightbulb

Quote:
Originally Posted by panknil
Dear all,
how can i send mail using mailx or mail command?do i need to configure anything for sending mail?please help me.Its urgent.
the version i use is
Linux TDM 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linux

Thanks
Regards,
Pankaj
Hey

YOu don;t need to configure any thing, but ya make sure that your varsion have reference to command mail or mailx.

cat file1 | mailx -s $Subject $MailRecievers

file1 having the contents to be mailed.
$Subject having title of the mail
$MailRecievers haveing names of the mail recievers.

or

echo "Alter, Boss is there !! " | mailx -s "Boss" "abc.com"

Hope you got this !!
Otherwise goto "man mail" and explore it !Smilie
# 3  
Old 09-18-2007
Hammer & Screwdriver Try This one

For sending the mails thru CLI via mail and mailx, You must have SMTP server. If you have SMTP Server you can use mail or mailx to sending the mails.

mail -s "Subject Whatever you want" user@your-domain.com < File_Name

File_Name file is contains contents for your mail body.


~~~Sanjay~~~
# 4  
Old 09-18-2007
Mail Sending

Dear Sanjay,
thanks for your kind help but i have tried with you have suggested but not working
i have triedmail -s "test" pankaj.choudhury@tcs.com < hi
but its not working.

thanks
regards
pankaj
# 5  
Old 09-18-2007
Give some info

Lets try step by step

1:- First check do you have SMTP service on in your Linux/UnixBox or not
Then create one file
> echo " Hi this is just for testing" >/tmp/testmail

Then send it via mail command

> mail -s "Testing" pankaj.choudhury@tcs.com < /tmp/testmail

Try to see the logs

> tail -n 50 /var/log/messages

If it will not work send me the log mesages, so I will suggest you somthing in better way

So Dun worry !!! Start

~~~Sanjay Tripathi~~~
# 6  
Old 09-18-2007
Mail Sending

Dear Sanjay,
as you suggested me i'm sending you the log

Sep 17 21:04:54 TDM nmbd[8255]: [2007/09/17 21:04:54, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 17 21:04:54 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 17 21:04:54 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 17 21:29:55 TDM nmbd[8255]: [2007/09/17 21:29:55, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 17 21:29:55 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 17 21:29:55 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 17 21:54:55 TDM nmbd[8255]: [2007/09/17 21:54:55, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 17 21:54:55 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 17 21:54:55 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 18 00:44:57 TDM nmbd[8255]: [2007/09/18 00:44:57, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 00:44:57 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 00:44:57 TDM nmbd[8255]: This response was from IP 172.17.181.234, reporting an IP address of 172.17.181.234.
Sep 18 03:59:57 TDM nmbd[8255]: [2007/09/18 03:59:57, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 03:59:57 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 03:59:57 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 18 04:49:58 TDM nmbd[8255]: [2007/09/18 04:49:58, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 04:49:58 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 04:49:58 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 18 05:24:58 TDM nmbd[8255]: [2007/09/18 05:24:58, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 05:24:58 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 05:24:58 TDM nmbd[8255]: This response was from IP 172.17.181.234, reporting an IP address of 172.17.181.234.
Sep 18 06:39:58 TDM nmbd[8255]: [2007/09/18 06:39:58, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 06:39:58 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 06:39:58 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 18 07:39:59 TDM nmbd[8255]: [2007/09/18 07:39:59, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 07:39:59 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 07:39:59 TDM nmbd[8255]: This response was from IP 172.17.182.16, reporting an IP address of 172.17.182.16.
Sep 18 08:04:58 TDM nmbd[8255]: [2007/09/18 08:04:58, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 08:04:58 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 08:04:58 TDM nmbd[8255]: This response was from IP 172.17.181.234, reporting an IP address of 172.17.181.234.
Sep 18 09:29:58 TDM nmbd[8255]: [2007/09/18 09:29:58, 0] nmbd/nmbd_namequery.c:query_name_response(101)
Sep 18 09:29:58 TDM nmbd[8255]: query_name_response: Multiple (2) responses received for a query on subnet 172.17.181.187 f
Sep 18 09:29:58 TDM nmbd[8255]: This response was from IP 172.17.181.234, reporting an IP address of 172.17.181.234.
Sep 18 09:49:11 TDM su(pam_unix)[9357]: session opened for user tdmscrdr by tdmscrdr(uid=504)
Sep 18 10:09:18 TDM smbd[19543]: [2007/09/18 10:09:18, 0] smbd/service.c:make_connection(850)
Sep 18 10:09:18 TDM smbd[19543]: 01hw084873 (172.17.180.191) couldn't find service .
Sep 18 11:14:46 TDM su(pam_unix)[12282]: session opened for user oracle by tdmscrdr(uid=504)
Sep 18 12:02:10 TDM su(pam_unix)[12282]: session closed for user oracle
Sep 18 12:16:28 TDM su(pam_unix)[15689]: session opened for user oracle by tdmscrdr(uid=504)
Sep 18 12:35:51 TDM su(pam_unix)[15689]: session closed for user oracle
Sep 18 13:01:58 TDM su(pam_unix)[18492]: session opened for user oracle by tdmscrdr(uid=504)
Sep 18 13:03:23 TDM su(pam_unix)[18492]: session closed for user oracle
Sep 18 14:36:38 TDM su(pam_unix)[22812]: session opened for user oracle by tdmscrdr(uid=504)
Sep 18 14:36:49 TDM su(pam_unix)[22812]: session closed for user oracle
Sep 18 14:37:22 TDM su(pam_unix)[22941]: authentication failure; logname=tdmscrdr uid=504 euid=0 tty= ruser=tdmscrdr rhost=
Sep 18 14:37:31 TDM su(pam_unix)[22944]: session opened for user oracle by tdmscrdr(uid=504)
Sep 18 14:59:17 TDM su(pam_unix)[23858]: session opened for user oracle by tdmscrdr(uid=504)
Sep 18 15:42:45 TDM su(pam_unix)[26395]: authentication failure; logname=tdmscrdr uid=503 euid=0 tty= ruser=tdmscrndr rhost=
Sep 18 15:48:05 TDM su(pam_unix)[27317]: session opened for user root by tdmscrdr(uid=503)
Sep 18 15:50:57 TDM su(pam_unix)[27317]: session closed for user root

thnx
regards,
Pankaj
# 7  
Old 09-18-2007
Hammer & Screwdriver Some qucik info

It seems to me your Linux/Unix box very busy so just give me the logs

grep -i "pankaj.choudhury@tcs.com" /var/log/messages

Because I didn't get any logs related to your SMTP, So send me the output of above command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies

2. UNIX for Dummies Questions & Answers

Sending mail

How can i send a mail when user login in unix ENV. How can i know present use mailID?? Moved out of Contact Us Forum - Please Do Not Post Technical Questions in Non-Technical Forum(s) (1 Reply)
Discussion started by: arun508.gatike
1 Replies

3. Shell Programming and Scripting

Sending Mail

Hi All, I have a script that looks like this: *********** #!/bin/sh -x cd /u01/app/oracle/diag/rdbms/spdb/spdb/trace cat alert_spdb.log|grep Archiver >/dev/null if ; then mailx -s "Archiver message in Alert log" user@email.com fi ************ Im using the -x option to see any... (1 Reply)
Discussion started by: oradba888
1 Replies

4. Shell Programming and Scripting

Stop sending mail after certain number of mail

Hi guys... I am busy writing a script to notify me via an mail if my application is down. I have done that. Now I want this script to stop sending mails after five mails were sent but the script should keep on checking the application. When the application is up again that count should be... (5 Replies)
Discussion started by: Phuti
5 Replies

5. Shell Programming and Scripting

Sending mail

Hi there, How can I send the automated log file, daily at 7 am to the respective mail . Thanks in Advance, Neha (2 Replies)
Discussion started by: NehaKrish
2 Replies

6. UNIX for Dummies Questions & Answers

sending mail

i want to send an email from the unix machine to the windows machine. now windows dont have any specified folder for the mail. mail has to be sent to the email-id like abc@xyz.com unix machine itself can not directly send mail. it has to be transferred via mail server. (11 Replies)
Discussion started by: parmeet
11 Replies

7. Ubuntu

help sending mail

Hi, I have kubuntu 8.10 and I would like to configure Ubuntu to can send mail from command line with mailx. I've saw that I need to install a MTA. But I don't know with install and how. Do you know some howto or url where I find how could I configure it? Many thanks and sorry for my... (2 Replies)
Discussion started by: mierdatuti
2 Replies

8. HP-UX

hp ux not sending mail

Hi.. In Hp ux box,, mails are not being sent. they are getting queued up in mail queue. (3 Replies)
Discussion started by: kkhan
3 Replies

9. UNIX for Advanced & Expert Users

sending mail

How do I send an email with a subject and an attachment from a command prompt? (3 Replies)
Discussion started by: mskarica
3 Replies

10. UNIX for Dummies Questions & Answers

sending a mail to a mail client

Hi everyone! I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string. Is there a way to send this message to a mail client using SMTP? Even better, is there any place on this site that has these kinds of... (5 Replies)
Discussion started by: solaris73
5 Replies
Login or Register to Ask a Question