Sending Mails to the Multiple Email Address | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Sending Mails to the Multiple Email Address

Solaris


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-20-2013
Pramod_009 Pramod_009 is offline
Registered User
 
Join Date: Sep 2013
Last Activity: 10 April 2014, 10:30 AM EDT
Location: Bangalore
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Sending Mails to the Multiple Email Address

Hi All,

I am pretty new to the mail service in Sun Solaris 5.10. If anybody help me in writing a script for the multiple recipient with subject and the body would be a helpful.

Kindly help...

Thanks in advance.

Warm Regards,
Pramod
Sponsored Links
    #2  
Old 12-20-2013
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
Moderator
 
Join Date: Jan 2007
Last Activity: 24 April 2014, 6:29 AM EDT
Location: Варна, България / Milano, Italia
Posts: 5,642
Thanks: 177
Thanked 608 Times in 566 Posts

Code:
printf '%s\n' 'your mail body' | mailx -s 'your subject' 'first@address second@address ...'

Sponsored Links
    #3  
Old 12-20-2013
Pramod_009 Pramod_009 is offline
Registered User
 
Join Date: Sep 2013
Last Activity: 10 April 2014, 10:30 AM EDT
Location: Bangalore
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Hi, Radoulov,

The below is the code which i put in the script. It ran without any error and the exit status as 0 but i didn't receive any mail on the mentioned email id. Could you please tell me what would be the problem or do i need to configure any file for the same. Kindly suggest.


Code:
Email="abc@gmail.com"
Subject="FILES STATUS"
printf '%s\n' 'FILE HAS BEEN SENT TO DMP' | mailx -s '${Subject}' '{Email}'

exit $?

Thanks in Advance
Pramod

Last edited by Scott; 12-20-2013 at 09:04 AM.. Reason: Code tags, please...
    #4  
Old 12-20-2013
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 23 April 2014, 4:36 AM EDT
Location: Aachen, Germany
Posts: 3,534
Thanks: 51
Thanked 824 Times in 786 Posts
Well, don't use single quotes around the variables as they prevent expansion. Use double quotes. And, don't forget the $ sign in front of the Email variable.
Sponsored Links
    #5  
Old 12-27-2013
Pramod_009 Pramod_009 is offline
Registered User
 
Join Date: Sep 2013
Last Activity: 10 April 2014, 10:30 AM EDT
Location: Bangalore
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Hi All,

I am unable to send any files with the below code. If the code is ok, then how can i check whether the mail server is working or not.
Operating System : Sun Solaris 5.10
A Prompt reply would be appreciable.


Email="abc@gmail.com"
Subject="FILES STATUS"
echo "file has been sent to XYZ" | mailx -s "${Subject}" "${Email_Recipient}"



Thanks in advance.
Sponsored Links
    #6  
Old 12-27-2013
RudiC RudiC is offline Forum Advisor  
Registered User
 
Join Date: Jul 2012
Last Activity: 23 April 2014, 4:36 AM EDT
Location: Aachen, Germany
Posts: 3,534
Thanks: 51
Thanked 824 Times in 786 Posts
Why don't you use the Email variable defined?
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending email with multiple files.. msrahman Shell Programming and Scripting 30 11-03-2010 01:58 PM
Email sent to multiple user address? proghack Shell Programming and Scripting 15 10-13-2010 11:14 PM
Sending email to multiple IDs sangharsh HP-UX 3 02-25-2010 02:03 PM
Sending mails to various users without hard coding the email IDS manas6 UNIX for Dummies Questions & Answers 9 06-03-2008 07:54 AM
Sending Multiple Files through email nbvcxzdz Shell Programming and Scripting 4 03-29-2005 08:49 AM



All times are GMT -4. The time now is 09:34 AM.