LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-21-2006, 11:58 PM   #1
matiasquestions
Member
 
Registered: Sep 2005
Posts: 65

Rep: Reputation: 15
Sending mail from command line


Hi,

How can I send a mail to a smtp server from a bash script??

Thanks!.
 
Old 01-22-2006, 09:15 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
Most distributions include the mail command (man for details):

cat somefile.txt | mail -s "some subject" someuser@somedomain.com
 
Old 01-22-2006, 10:49 AM   #3
matiasquestions
Member
 
Registered: Sep 2005
Posts: 65

Original Poster
Rep: Reputation: 15
But without an mta!

Hi, thanks for replying, but that's not wat I need, because as far as I understand, "mail" requires a local mta properly configured on the system, an that's too much overhead for my requeriments.

I just want to connect to a remote (ISP) smtp server with my login info, and send a mail to someone from the command line (a very simple bash script I'm writing).


Thanks.
 
Old 01-22-2006, 11:01 AM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
That's doable as well. Take a look at this bash example script.
 
Old 01-22-2006, 11:17 AM   #5
matiasquestions
Member
 
Registered: Sep 2005
Posts: 65

Original Poster
Rep: Reputation: 15
This is what I was looking for!!:

http://nail.sourceforge.net/

I'm going to try it.

Thanks.
 
Old 01-22-2006, 11:51 AM   #6
vls
Member
 
Registered: Jan 2005
Location: The grassy knoll
Distribution: Slackware,Debian
Posts: 192

Rep: Reputation: 30
Nail is an excellent little mail program and doesn't require sendmail as you've probably noticed by now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
command-line email sending ixion Linux - Software 9 08-01-2008 06:46 AM
Sending an attachment from a command line RonnyNussbaum Linux - Software 12 06-04-2007 11:47 AM
sending mail from command line won't work disorderly Linux - General 2 06-09-2005 11:29 AM
sending msgs thru command line citrus Linux - Software 3 04-13-2004 02:39 AM
Sending Email's from command line jlaruffa Linux - Newbie 0 06-04-2003 03:31 PM


All times are GMT -5. The time now is 03:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration