Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Send email from the terminal?

Send email from the terminal?
Thread Tools
Fresh-Faced Recruit
Join Date: Nov 2000
Location: Davis, CA, USA
Status: Offline
Reply With Quote
Nov 30, 2000, 05:41 PM
 
I'm writing some super simple shell scripts, one of which relays the uptime of my OSX PB computer to my ICQ email addresss, which in turn, gets sent to my ICQ client.

Will Pine, or some similar email client fit my need for just a simple mail client that can send mail from the command prompt? All I need is something that can send mail to a specific address, and include a short message of just a line or two.

Thanks!
-THX
Just because Windows users vastly outnumber Mac users, numbers alone do not denote a higher form of life. Cøckroaches outnumber humans many times over, and no one says a cøckroach is better than a human.
     
Forum Regular
Join Date: Oct 2000
Location: Portland, OR USA
Status: Offline
Reply With Quote
Dec 1, 2000, 12:13 PM
 
You can use 'sendmail -t'. Simply pipe a message to it and it will take care of the rest. Don't forget to use the headers ('To:', 'Content-Type:', etc.). Additionally, there should be a mail (or Mail) command that you can use, though I prefer the control of writing my own headers with sendmail.
     
THX1138  (op)
Fresh-Faced Recruit
Join Date: Nov 2000
Location: Davis, CA, USA
Status: Offline
Reply With Quote
Dec 2, 2000, 06:07 PM
 
Duh I never thought of piping a message to sendmail.

Thanks!
-THX

------------------
Just because Windows users vastly outnumber Mac users, numbers alone do not denote a higher form of life. ****roaches outnumber humans many times over, and no one says a ****roach is better than a human.
Just because Windows users vastly outnumber Mac users, numbers alone do not denote a higher form of life. Cøckroaches outnumber humans many times over, and no one says a cøckroach is better than a human.
     
scruffy
Guest
Status:
Reply With Quote
Dec 17, 2000, 11:15 PM
 
sendmail will probably work, I haven't tried it, but it's not designed to be used that way. The command that is more meant for sending mail from the terminal is just "mail"

mail -s {subject} someone@some.where < {file with message}

will read the message out of the file, or you can just type

mail -s {subject} someone@some.where

and hit return. then you can type the message one line at a time. When the message is done, send an end-of-file marker with control-D.
     
Forum Regular
Join Date: Dec 2000
Status: Offline
Reply With Quote
Dec 18, 2000, 04:32 PM
 
I donno... sendmail says it's supposed to be an interface for other programs to use, while mail is a [lousy] interface for humans.
Sendmail can do stuff you might want in an auto-mailer... like not allowing the message to bounce if it's not deliverable. That way if you can't reach the server, everything stays quiet instead of getting buried in error messages...
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:19 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2