Send file attachement in mail | 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.

Send file attachement in mail

Solaris


Tags
solaris, unix and linux

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-05-2013
nes nes is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 23 April 2014, 12:17 AM EDT
Posts: 21
Thanks: 18
Thanked 0 Times in 0 Posts
Send file attachement in mail

Hello,

I am able to attache the file in UNIX/LINUX script using following code.


Code:
MAILFORMAT="Please do not replay this mail.This mail is auto generated."
 
echo -e $MAILFORMAT | mailx -r autoreplay@gmail.com -a filename -s "status" xyz@gmail.com

But same I am not able attache the file in Sunos system in script.

Please advise.
Sponsored Links
    #2  
Old 12-05-2013
zozoo zozoo is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 10 February 2014, 4:27 AM EST
Posts: 94
Thanks: 27
Thanked 10 Times in 10 Posts
u need to use uuencode for attaching files in mail

Code:
uuencode sample sample |mailx -r autoreplay@gmail.com -s "status" xyz@gmail.com

Sponsored Links
    #3  
Old 12-05-2013
Corona688 Corona688 is online now Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 24 April 2014, 7:42 PM EDT
Location: Saskatchewan
Posts: 18,539
Thanks: 682
Thanked 3,036 Times in 2,856 Posts
Most modern email clients do not understand uuencode. I found a perl script some some ago which can compute attachments in modern base64 form.
    #4  
Old 12-06-2013
nes nes is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 23 April 2014, 12:17 AM EDT
Posts: 21
Thanks: 18
Thanked 0 Times in 0 Posts
Thanks Zozoo,

But in SunOs it is not working. Please advice to attach the file in mail for Sunos system.
Sponsored Links
    #5  
Old 12-06-2013
zozoo zozoo is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 10 February 2014, 4:27 AM EST
Posts: 94
Thanks: 27
Thanked 10 Times in 10 Posts
it works for me fine in Solaris
u can try
Code:
uuencode

then pipe it to
Code:
mail

---------- Post updated at 01:30 PM ---------- Previous update was at 12:40 PM ----------

u can try for other methods from below link

Code:
http://www.shelldorado.com/articles/...tachments.html

The Following User Says Thank You to zozoo For This Useful Post:
nes (12-09-2013)
Sponsored Links
    #6  
Old 12-06-2013
MadeInGermany MadeInGermany is online now Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 24 April 2014, 7:34 PM EDT
Posts: 1,613
Thanks: 90
Thanked 456 Times in 413 Posts
Solaris mailx does not have -a option.
But the following seems to work

Code:
MAILFORMAT="Please do not replay this mail.This mail is auto generated."
FILENAME=file.csv

mailx -r autoreplay@gmail.com -s "status" xyz@gmail.com << _EOM
$MAILFORMAT

`uuencode $FILENAME $FILENAME`
_EOM

The Following User Says Thank You to MadeInGermany For This Useful Post:
nes (12-09-2013)
Sponsored Links
    #7  
Old 12-09-2013
nes nes is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 23 April 2014, 12:17 AM EDT
Posts: 21
Thanks: 18
Thanked 0 Times in 0 Posts
Thanks ZoZoo,

There was problem with environment, but now it is working fine.

your link is very useful ......
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
How to send a mail with attachement as well as message Body..? psiva_arul Shell Programming and Scripting 1 07-09-2008 12:51 PM
Send email with attachement-Getting connection refused by domain samuelc UNIX for Dummies Questions & Answers 1 02-08-2008 11:25 AM
How to send Mail with Attachement chgopi Shell Programming and Scripting 6 02-03-2006 04:46 AM
Send a mail with an attachement of a file gaddeg UNIX for Dummies Questions & Answers 2 07-23-2002 02:01 PM
Send a mail with a subject and an attachement josecollantes UNIX for Dummies Questions & Answers 1 08-27-2001 11:55 PM



All times are GMT -4. The time now is 07:51 PM.