Mail in bash


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Mail in bash
# 1  
Old 07-18-2009
Mail in bash

I'm reading about the mail program right now -- but there doesn't seem to be a lot in the book I'm reading. Does it work the same as, say, Apple Mail? In other words, can I use it to send a message over the net to another computer, or does it only work between two machines running Unix? (if I asked that correctly)
# 2  
Old 07-20-2009
mail, mailx, and sendmail will send email locally and to internet-wide addresses - if configured correctly.
# 3  
Old 07-22-2009
Can you tell me how to configure it so I can send mail to others over the net?

Apple mail may be more convenient, but I'd like to learn about this as much as I can. The book I have doesn't really talk about configuring it -- only a page or so about mail variables.
# 4  
Old 07-22-2009
Apple Mail is mail program like Outlook or Thunderbird, it's GUI based Smilie. Mac OS has mail, and can be used from Terminal and in scripts. Open terminal and type:
Code:
mail

# 5  
Old 07-23-2009
what i meant was - how do i send mail from the terminal? I typed man mail, but I have to say I'm not familiar with the terms and not sure how to proceed.

I've tried mail [email address] entered a subject and tried to send the message to my gmail account (which I can download with apple mail), but nothing.
# 6  
Old 07-23-2009
Straitsfan:

Try the following:

Code:
mailx -s "email subject" emailaddresstosendto@domain.tld <<< "email message"


Last edited by drewrockshard; 07-23-2009 at 01:57 PM.. Reason: Placed code tags around command since I forgot initially
# 7  
Old 07-23-2009
Type exactly as you instructed, correct? I tried that and got nothing.

I'm guessing that maybe I need to create a file or configure something?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bold text in Bash and send mail

I have a sample script here I want to bold the word BOLD in the text and send through email. Tried several ways but not seems to working. BODY="Hello. I want to BOLD this" { echo "From: from@gmail.com" echo "To: to@gmail.com" echo "Subject: Texting" ... (1 Reply)
Discussion started by: lpoolfc
1 Replies

2. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

3. Shell Programming and Scripting

Bash Script - Mail Secure.log

I'm putting together a fairly simple script, to check "secure.log" for content and email the results in a cron, nightly. The script runs fine upon manual execution, it's a problem when ran in cron. This is on a Mac server. Any thoughts? #!bin/bash #Email secure.log, nightly. Subject="Secure... (6 Replies)
Discussion started by: Nvizn
6 Replies

4. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

5. Shell Programming and Scripting

scripting Bash to access ISP mail

I'm trying to create a small program to look at my isp and pull down the messages into individual text files. This is just a read only setup. I need to pull down the message and kill it on the server. I'm stuck here. I have experimented with a for string but it always fails. I was trying to use... (0 Replies)
Discussion started by: Mikey
0 Replies

6. Shell Programming and Scripting

How can i send mail to multiple addresses in same domain in bash?

Suppose i have a txt file that is the list of the addresses,something like: lala0045 john james lala0234 george james and i want to send an email to lala0045@blabla.com and lala0234@blabla.com,the same domain...what is the exact syntax i should use in my script? there is a command... (10 Replies)
Discussion started by: bashuser2
10 Replies

7. Shell Programming and Scripting

sending mail via Bash

Hello , I want to send mail via bash script but i want to add from parameter for example i want to send to test@gmail.com and the sender will be test2@gmail.com Thanks for all (1 Reply)
Discussion started by: LinuxCommandos
1 Replies

8. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

9. Shell Programming and Scripting

Mail using bash script

Hi, I am trying to write a script which emails the status of the job to the client. I am using bash script. I tried using mailx and the shell throws an error that 'command not found'. is mailx not supported in bash. Alternatively, is there any command that i can use for sending email in bash? ... (5 Replies)
Discussion started by: borncrazy
5 Replies

10. UNIX for Dummies Questions & Answers

mail problem (NOT Mail or Mail.app)

When I try to use the CLI mail, I get the following error. What's wrong? Welcome to Darwin! % mail root Subject: test test . EOT % /etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory Do I just need to change the... (1 Reply)
Discussion started by: chenly
1 Replies
Login or Register to Ask a Question