The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers > Answers to Frequently Asked Questions > How do I send email?
.
google unix.com



How do I send email? Learn how to send a UNIX or Linux email attachment from the command line.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Send mail attachments and have a mail body shibajighosh AIX 1 04-18-2008 01:54 PM
Pull E-mail address from file, send e-mail DC Heard Shell Programming and Scripting 1 01-29-2008 02:23 AM
mail problems - how to send mail on solaris amon SUN Solaris 10 04-06-2006 09:31 AM
I am not able to send mail form unix to other mail accounts. chinnigd UNIX for Dummies Questions & Answers 1 04-06-2006 08:31 AM
can not send mail from unix server to company/yahoo mail b5fnpct UNIX for Dummies Questions & Answers 5 11-22-2002 09:24 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-19-2004
piltrafa's Avatar
piltrafa piltrafa is offline
Registered User
  
 

Join Date: Oct 2001
Location: Buenos Aires, Argentina
Posts: 77
events send mail to admin -

Hi everybody !!

I want to do something and I can't figure out. The idea is that a script should send an email when a backup is done.
It works with a unix account (like root) but what I really want is to send that email to other account like fede@somethig.com.

I have a mail server installed in other computer, all these boxes are running solaris 9.

I believe that I should tell the box that is running the backup script to send the email using other mail server, but I don't know how to do it.

Also, as a test, I tried: mail -t myaccount@stuff.com, and it doesn´t work. (of course the email acount exist...)

So if someone can help me, I'll send a pack of six beers...

Thanx a lot.
  #2 (permalink)  
Old 04-19-2004
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
  
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
it really depends on how your doing the backup in the first place.

for me. i run my backups via cron and i have the output goto the cronusers email. you can always pipe the output to the mail command and then you can specify which user.

some backup software allows you to configure users to be notified when an event happens. so i would check your software docs and see what you can come up with, or talk with the people that manage the backups and set it up in the first place they would prolly have the most valuable information for you.
  #3 (permalink)  
Old 04-19-2004
piltrafa's Avatar
piltrafa piltrafa is offline
Registered User
  
 

Join Date: Oct 2001
Location: Buenos Aires, Argentina
Posts: 77
No, it is just a normal script like:

----------------------------------------
# !/bin/bash

cd /tmp
cp /tmp /home/mystuff

# and when the copy is done I want to be informed by mail
# but not to my unix account like root, I want the mail to, for # example, myaccount@hotmail.com.

????

------------------------------------------

Thanks for your help
  #4 (permalink)  
Old 04-19-2004
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,661
You can create a shell script and test to see if it executes without error. If it executes without error, then you can email a success message; if with error, you can email an error message.

Take a look at error codes, for example:

ps aux | grep grep | grep -v grep ; echo $?

Then try:

ps aux | grep grep; echo $?

Are the results the same? Why not?
  #5 (permalink)  
Old 04-20-2004
piltrafa's Avatar
piltrafa piltrafa is offline
Registered User
  
 

Join Date: Oct 2001
Location: Buenos Aires, Argentina
Posts: 77
Thanks, but my problems is not with the script, what I really don't know how to do is sending the mail from a command.

mail -t sends a mail only to unix account and I want to send the mail to an "outside" mail account like something@hotmail.com

Thanks again.
  #6 (permalink)  
Old 04-20-2004
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,661
Try this:

echo "Hello World!" | elm -s "Hello World Message" your_name@your.domain.com
  #7 (permalink)  
Old 04-20-2004
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
I think mailx is the standard front-end for sendmail and elm is HP-UX only(?)

echo "Hello World!" | mailx -s "Hello World Message" your_name@your.domain.com
 

Bookmarks

Tags
linux, sendmail, solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0