Mail using bash script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mail using bash script
# 1  
Old 07-19-2004
Question 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?


Thanks in adv
# 2  
Old 07-19-2004
Hi,

Which OS are you using?
Try adding the complete path to the mail command you are using.
On a standard Solaris installation the path to mailx is /usr/bin/mailx.

What are you trying to do with the script?
Should it send you a text message or send an attachment?

-Joe
# 3  
Old 07-19-2004
Hi,

I am using Linux.

I just need to send a text message...Nothing else...
# 4  
Old 07-19-2004
Sorry!

Linux doesn't have mailx as a standard package.
You'll have to use mail.
Did you say you are writing the script in sh? If so, you'll be happy to know that sh is a link to bash!
All of your sh scripts should work as expected though.

-Joe
# 5  
Old 07-19-2004
MySQL

Hi,

I got this working.....

There was a problem at the server end and the mails were not getting delivered..I thought i was doing a mistake.Checked with the admin team and got it resolved.

Thanks for the help
# 6  
Old 07-21-2004
Hi,

Can i send an attachement through mail synatx... I tried to search the man pages but could not find any option...

Is there any alternative to fro sending an email with a text attachment or inline text thru email using bash


Thanks in adv
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

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

4. 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

5. Shell Programming and Scripting

script to read mail on a mail server

Hi All, Is there any way Unix shell script can directly read a mail on a mail server (for eg. abc@xyz.com) and save it as a text file in a unix directory ? Thanks PRKS ---------- Post updated at 08:37 AM ---------- Previous update was at 08:36 AM ---------- I am using ksh (1 Reply)
Discussion started by: PRKS
1 Replies

6. UNIX for Dummies Questions & Answers

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... (8 Replies)
Discussion started by: Straitsfan
8 Replies

7. 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

8. 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

9. 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

10. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies
Login or Register to Ask a Question