Unix/Linux 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

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-05-2013
nes nes is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 26 May 2014, 11:06 AM EDT
Posts: 27
Thanks: 23
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. Linux
Sponsored Links
    #2  
Old Unix and Linux 12-05-2013
zozoo zozoo is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 20 April 2015, 1:46 AM EDT
Posts: 103
Thanks: 29
Thanked 11 Times in 11 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 Unix and Linux 12-05-2013
Corona688 Corona688 is online now Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 28 July 2015, 1:25 PM EDT
Location: Saskatchewan
Posts: 20,771
Thanks: 901
Thanked 3,704 Times in 3,460 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 Unix and Linux 12-06-2013
nes nes is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 26 May 2014, 11:06 AM EDT
Posts: 27
Thanks: 23
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 Unix and Linux 12-06-2013
zozoo zozoo is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 20 April 2015, 1:46 AM EDT
Posts: 103
Thanks: 29
Thanked 11 Times in 11 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 Unix and Linux 12-06-2013
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 28 July 2015, 6:56 AM EDT
Location: Simplicity
Posts: 2,529
Thanks: 188
Thanked 765 Times in 693 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 Unix and Linux 12-09-2013
nes nes is offline
Registered User
 
Join Date: Nov 2013
Last Activity: 26 May 2014, 11:06 AM EDT
Posts: 27
Thanks: 23
Thanked 0 Times in 0 Posts
Thanks ZoZoo,

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

your link is very useful ...... Linux
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 01:42 PM.