sending mail from terminal

Is any tool to send mails from terminal?
Also i have a tool named mail.
Can this do the job?
I tried it but stack on subject.
I give subject name but is not continuing.
Just stay there an do nothing
For example
Code:
mail -v ska8harddiefast@gmail.com
Subject: test

ehfd;wefdqwie
eqwejq2po3
jqwepq3
jdpq223e12


dqdeqwd

After test & enter understand everything i write but is not going to the section "write the mail"

Code:
ehfd;wefdqwie
eqwejq2po3
jqwepq3
jdpq223e12


dqdeqwd
This is not the mail. Is the continue of subject :OOO
 
I tried that and i take this
Code:
mail -v sk8harddiefast@gmail.com
Subject: test
^DEOT
Null message body; hope that's ok
sk8harddiefast@gmail.com... Connecting to [127.0.0.1] via relay...
220 bsdserver.bsd ESMTP Sendmail 8.14.3/8.14.3; Fri, 23 Jul 2010 14:33:04 +0300 (EEST)
>>> EHLO bsdserver.bsd
250-bsdserver.bsd Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<deadreamer@bsdserver.bsd> SIZE=44
250 2.1.0 <deadreamer@bsdserver.bsd>... Sender ok
>>> RCPT To:<sk8harddiefast@gmail.com>
>>> DATA
250 2.1.5 <sk8harddiefast@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o6NBX4wh020798 Message accepted for delivery
sk8harddiefast@gmail.com... Sent (o6NBX4wh020798 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 bsdserver.bsd closing connection
 
Put a period (.) on an empty line. That tells mail to stop.
 
Code:
$ mail -v -s "The subject goes here" someone@somewhere.net [enter]                                                              
Hey, how's it going? [enter]
. [enter]

That's all.
 
You can also put the body of the email in a text file, and run:

Code:
cat textfile | mail -v -s "Some subject" somewhere@somewhere.net [enter]

The end of the textfile will cause the EOT and send the mail.
 
I take this:
Code:
You have new mail in /var/mail/deadreamer
But why here? I gave my gmail. Logical shouldn't be sent on my gmail account?
 
You're probably seeing a bounce? You need a valid sender address to get it accepted anywhere.
 
Code:
You need a valid sender address to get it accepted anywhere
I give my email address. Is a valid address.
I take exactly this
Code:
mail -v -s test sk8harddiefast@ %&#$%^^.com [enter]
Hi. My name is George [enter]
.[enter]
EOT
sk8harddiefast@ %&#$%^^.com... Connecting to [127.0.0.1] via relay...
220 bsdserver.bsd ESMTP Sendmail 8.14.3/8.14.3; Sun, 25 Jul 2010 11:44:20 +0300 (EEST)
>>> EHLO bsdserver.bsd
250-bsdserver.bsd Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<deadreamer@bsdserver.bsd> SIZE=66
250 2.1.0 <deadreamer@bsdserver.bsd>... Sender ok
>>> RCPT To:<sk8harddiefast@ %&#$%^^.com>
>>> DATA
250 2.1.5 <sk8harddiefast@ %&#$%^^.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 o6P8iKmq016611 Message accepted for delivery
sk8harddiefast@ %&#$%^^.com... Sent (o6P8iKmq016611 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 bsdserver.bsd closing connection
Seems to be ok. But i don't see any mail on my $^#%$^& account :OOO
 
If you don't want to get spam in your inbox, I suggest you remove your address from your posts.

As for your problem, maybe the message has not been sent yet. Check the queue with mailq(1).
 
Look in your maillog. If you are sending with the *.bsd domain, it won't be accepted anywhere (except localhost, maybe) as it is not a valid Internet domain.
 
Look in your maillog. If you are sending with the *.bsd domain, it won't be accepted anywhere (except localhost, maybe) as it is not a valid Internet domain.
Where is maillog?
What i should do? I have completely no idea :/
 
I take this:
Code:
You have new mail in /var/mail/deadreamer
But why here? I gave my gmail. Logical shouldn't be sent on my gmail account?
When you send the mail, you use your local user mail to send the mail to your account in GMail

The mail you received locally, is maybe a notification of a reject by the GMail server and what caused (in this case your local address isn't valid in Internet)

What you may be looking is in the Handbook, in the section Setting Up to Send Only (the use of mail/ssmtp)
 
WOW!!!! This thread takes me back to the 80s with BY Telecom Gold and cix.compulink.

Sending emails and newsgroups on text based systems where attacments required a great deal of thought, We could even send telexs on Telecom Gold.

I though I was so smart and leading edge back then.
 
Sending emails and newsgroups on text based systems where attacments required a great deal of thought
Seriously, try (neo)mutt. I still use it as my daily mail driver. Sure, sometimes you receive a mail THAT braindead (e.g. including links, but not in the text/plain part, or this part is missing altogether) to make it a little hassle. But most of the time, there's nothing quicker and more efficient than a good MUA on the console.
 
Seriously, try (neo)mutt. I still use it as my daily mail driver. Sure, sometimes you receive a mail THAT braindead (e.g. including links, but not in the text/plain part, or this part is missing altogether) to make it a little hassle. But most of the time, there's nothing quicker and more efficient than a good MUA on the console.
Looking up mutt now.
 
Back
Top