How to mail in command line.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to mail in command line.
# 15  
Old 09-05-2008
Quote:
Originally Posted by era
Does "it didn't worked" mean you got command not found or that it looked like it sent a message, but you never received it? You really need to be a bit more specific.

(Annihilannic: it's Mail Transport Agent fwiw.)
What operating system are you using exactly? - " Fedora 8 "

I'm using mutt for sending a mail with attachment. It doesn't gave any error and also the message is not yet recieved.

" mutt -s "hi subject" mail_id@sample.com -a sample.pdf < message_mail.txt "

the message_mail.txt contain the boby of the mail
# 16  
Old 09-05-2008
If you telnet localhost 25 do you get a greeting banner identifying your MTA? (Type quit and press enter to terminate.)

Does mailq -v print anything?
# 17  
Old 09-07-2008
hi
This is message i got when i tried with the telnet
[root@home ~]# telnet localhost 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
[root@home ~]#
# 18  
Old 09-07-2008
Quote:
Originally Posted by era
Does mailq -v print anything?
You forgot to answer this one.
# 19  
Old 09-10-2008
hi era

I apologize for my poor response.

Here is the message which i got in with mailq -v
/var/spool/mqueue (13 requests)
-----Q-ID----- --Size-- -Priority- ---Q-Time--- --------Sender/Recipient--------
m7C3q2oI020832 2789 1022684 Aug 12 09:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7BNq2oI020408 2841 1382874 Aug 12 05:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7BMvjoH020313 883 1471464+Aug 12 04:28 <root@fedoratest>
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7B3q2pp017778 2789 3182684 Aug 11 09:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7ANq2pp017354 3489 3543522 Aug 11 05:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7AMvjpo017259 883 3631464+Aug 11 04:28 <root@fedoratest>
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7A8q2pn015286 2436 4892476 Aug 10 14:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m7A3q2pn014756 2957 5342852 Aug 10 09:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m79Mvkpm008828 1051 5791632+Aug 10 04:28 <root@fedoratest>
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m793q2Aw006186 3710 7503608 Aug 9 09:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m78MvkAv005667 1809 7952389+Aug 9 04:28 <root@fedoratest>
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m78Cq25l004093 3637 8853542 Aug 8 18:22 MAILER-DAEMON
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
m788OZ5k003617 1944 9302316+Aug 8 13:54 <root@fedoratest>
(host map: lookup (fedoratest): deferred)
<root@fedoratest>
Total requests: 13
# 20  
Old 09-10-2008
It can't find a host named fedoratest and so can't deliver to it.

Can you resolve it from the command line? Look into /etc/resolv.conf and related stuff. If it's a local, static host, maybe you just want to put its IP address in /etc/hosts
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Unable to set end of line in mail command

Hi , Am trying to send mail using the mail command, but the mail command is working but its not sending automatically after pressing .(dot) in the command prompt it sends . How to achieve that. Also it showing the below line after pressing the dot . /home/abc1/dead.letter... Saved message in... (5 Replies)
Discussion started by: rogerben
5 Replies

3. UNIX for Dummies Questions & Answers

POP3 Mail Client (Command Line)

Hi list, I need a POP3 mail client which I can use from the command line within a bash shell script to download email to a folder location. Can anyone recommend a good POP3 client which can be used from the command line in bash? Using redhat enterprise linux 5 and 6. thanks, Land (2 Replies)
Discussion started by: landossa
2 Replies

4. Shell Programming and Scripting

Send mail from command line

Hi All; I need to send emails from command line in some of my shell scripts. I tried : mail -s "Subject" member@body.com < testfile where test file contains body of the mail This work on my mac computer at work BUT not on my mac laptop. Does anyone have any ideas why? Thanks Walforum (1 Reply)
Discussion started by: walforum
1 Replies

5. UNIX for Dummies Questions & Answers

[SOLVED] Command line mail taking too long to send; unable to qualify my own domain name

Hello, I'm having a problem with my mail. When I send mail, it takes a long time for the send to complete. In the below, datestamp is just a simple script to put in a no-white-space date/time stamp. $ datestamp ; mail woodnt; datestamp 02-05-10@193844 Subject: test timer Cc: ... (0 Replies)
Discussion started by: Narnie
0 Replies

6. UNIX for Dummies Questions & Answers

Sending a simple mail from command line

Hi, How would one send an email from the command line. Just a simple email. I used mailx -s "test" address@server.domain then hit enter. Nothing happens then, I hit Ctrl + C twice, then I can start a new command again. Any help? Tips? I did read up on this, but the examples is much more... (2 Replies)
Discussion started by: McGuywer
2 Replies

7. Solaris

identify the mail server for mail command

Hi , I am new to unix , i am using the mail and mailx command to send the mail .How come i will know the my mail command using which server as mail box.. Please help me .. Thanks in advance (1 Reply)
Discussion started by: julirani
1 Replies

8. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command... (3 Replies)
Discussion started by: G-Man
3 Replies

9. UNIX for Dummies Questions & Answers

command line send mail

Hi, I am trying to send mail in ubuntu. I have installed postfix. In Redhat I could just type: mail name@domain.com I get the error that the command mail is not found. Does anyone know if there is a different command line to send mail? Can I install the command? Thanks, Eric (1 Reply)
Discussion started by: ejbrever
1 Replies

10. Shell Programming and Scripting

E-Mail from command line for UNIX and Perl??

Hi Is there any way to use UNIX and Perl to automate sending e-mail. I got a dynamic changing file that send out to people in my mailing list and want to experinment to see if Perl and UNIX can send it out for me when the content is change. I found a Perl source code but dont really know how to... (4 Replies)
Discussion started by: jy2728
4 Replies
Login or Register to Ask a Question