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 > Sending Mail from unix prompt

Sending Mail from unix prompt
Thread Tools
DaveNinja
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Sep 28, 2002, 03:48 PM
 
How cn i send mail from the unix prompt? I have a Perl program that i would like to have send a text message (via and email) to my cell phone. if i type 'mail [email protected]' and put somethign in the subject and body and send it, i never recieve it.

daveninja.com
daveninja.com
     
gioele
Forum Regular
Join Date: Apr 2002
Location: Italy
Status: Offline
Reply With Quote
Sep 28, 2002, 04:06 PM
 
Originally posted by DaveNinja:
How cn i send mail from the unix prompt?
Code:
cat << *eof this it the text of the mail... You can have as many lines as you like *eof | mail [email protected]
     
DaveNinja  (op)
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Sep 28, 2002, 05:33 PM
 
I still dont get the email that was sent.
its like the 'mail' function isnt sending the mail out of the computer

daveninja
daveninja.com
     
Mactoid
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status: Offline
Reply With Quote
Sep 28, 2002, 06:06 PM
 
Are you sure sendmail is running at all? OS X is not setup by default to be able to send mail like that.
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
     
DaveNinja  (op)
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Sep 28, 2002, 06:27 PM
 
sendmail not running is the problem. How do i start sendmail running?

daveinja
daveninja.com
     
DaveNinja  (op)
Forum Regular
Join Date: Jan 2001
Location: Sacramento, CA, USA USA USA
Status: Offline
Reply With Quote
Sep 29, 2002, 01:02 AM
 
I got sendmail running. i cant get the mail to leave my computer though.
daveninja.com
     
Mactoid
Grizzled Veteran
Join Date: Sep 2000
Location: Springfield, MA
Status: Offline
Reply With Quote
Sep 29, 2002, 03:35 PM
 
Do you mean that if you send a message to your local account it works?

Try checking for error messages in /var/log/mail.log, and in /var/tmp/console.log
We hope your rules and wisdom choke you / Now we are one in everlasting peace
-- Radiohead, Exit Music (for a film)
     
Camelot
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Sep 29, 2002, 04:54 PM
 
Originally posted by DaveNinja:
I got sendmail running. i cant get the mail to leave my computer though.
... and your mail logs say what, exactly?
Gods don't kill people - people with Gods kill people.
     
Mithras
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Sep 30, 2002, 07:24 AM
 
Make sure you've opened port 25 in your firewall and/or router.

For anyone joining late, this guide:
Configuring Sendmail on Jaguar at the O'Reilly DevCenter
was perfect for getting Sendmail up and running in 10.2
     
Zim
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status: Offline
Reply With Quote
Oct 3, 2002, 11:53 AM
 
Originally posted by DaveNinja:
How cn i send mail from the unix prompt? I have a Perl program that i would like to have send a text message (via and email) to my cell phone. if i type 'mail [email protected]' and put somethign in the subject and body and send it, i never recieve it.

daveninja.com
If you are doing this in perl, I have had good success with MIME::Lite

Code:
use MIME::Lite; my $msg = new MIME::Lite From => $from, To => $to, Cc => $optional, Subject => "Whatever", Type => 'TEXT', Data => "$string"; $msg->send;
You can even tell it to use a different smtp server (like your normal ISP server) (do a perldoc MIME::Lite for the info)

HTH,
Mike
     
   
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
Top
Privacy Policy
All times are GMT -4. The time now is 02:52 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,