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


Closed Thread    
 
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: 11 October 2014, 8:15 AM EDT
Location: Bangalore
Posts: 20
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: 19 December 2014, 9:35 AM EST
Location: Варна, България / Milano, Italia
Posts: 5,675
Thanks: 184
Thanked 620 Times in 578 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: 11 October 2014, 8:15 AM EDT
Location: Bangalore
Posts: 20
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 10: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: 20 December 2014, 11:18 AM EST
Location: Aachen, Germany
Posts: 4,888
Thanks: 80
Thanked 1,224 Times in 1,150 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: 11 October 2014, 8:15 AM EDT
Location: Bangalore
Posts: 20
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: 20 December 2014, 11:18 AM EST
Location: Aachen, Germany
Posts: 4,888
Thanks: 80
Thanked 1,224 Times in 1,150 Posts
Why don't you use the Email variable defined?
Sponsored Links
Closed Thread

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 02:58 PM
Email sent to multiple user address? proghack Shell Programming and Scripting 15 10-14-2010 12:14 AM
Sending email to multiple IDs sangharsh HP-UX 3 02-25-2010 03:03 PM
Sending mails to various users without hard coding the email IDS manas6 UNIX for Dummies Questions & Answers 9 06-03-2008 08:54 AM
Sending Multiple Files through email nbvcxzdz Shell Programming and Scripting 4 03-29-2005 09:49 AM



All times are GMT -4. The time now is 03:22 PM.