# mailx with attachment

**URL:** <https://community.unix.com/t/mailx-with-attachment/308924>\
**Category:** Solaris\
**Created:** [April 24, 2012, 1:05am UTC](https://community.unix.com/t/mailx-with-attachment/308924 "2012-04-24T01:05:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sridhardwh](https://community.unix.com/letter_avatar/sridhardwh/32/5_5575768a8748004e209b776fc1b2916d.png) [@sridhardwh](https://community.unix.com/u/sridhardwh)\
**Post date:** [April 24, 2012, 1:05am UTC](https://community.unix.com/t/mailx-with-attachment/308924/1 "2012-04-24T01:05:04Z")

</div>

Hi,  
When i used below command, i am able to send mail

```nohighlight
mailx -s "Testing mail working or not " babu.sudhakar@ymail.com"

```

but if i want send attachment with mail,which syntax i need to follow to send a file as attachment.

---

<div class="post-metadata">

**Author:** ![vikkash](https://community.unix.com/letter_avatar/vikkash/32/5_5575768a8748004e209b776fc1b2916d.png) [@vikkash](https://community.unix.com/u/vikkash)\
**Post date:** [May 1, 2012, 1:35pm UTC](https://community.unix.com/t/mailx-with-attachment/308924/2 "2012-05-01T13:35:39Z")

</div>

try

```nohighlight
uuencode "attachment file name"|mailx -s "Test mail" xyz@mail.com

```

It works for .csv files for me..Try and let me know as well 😃

---

<div class="post-metadata">

**Author:** ![gary\_w](https://community.unix.com/user_avatar/community.unix.com/gary_w/32/2088_2.png) [@gary\_w](https://community.unix.com/u/gary_w)\
**Post date:** [May 1, 2012, 2:07pm UTC](https://community.unix.com/t/mailx-with-attachment/308924/3 "2012-05-01T14:07:08Z")

</div>

This comes up all the time. Searching the site finds all kinds of examples.

[Google Search Results for mailx attachment | The UNIX and Linux Forums](http://www.unix.com/cfmgoogle.php?cx=partner-pub-6323928554267084%3Absye1r5tx7j&cof=FORID%3A10&q=mailx+attachment&sa=grep&siteurl=www.unix.com%2Fsolaris%2F183753-mailx-attachment.html%23post302633209&ref=www.unix.com%2F)

---

<div class="post-metadata">

**Author:** ![juan.brein](https://community.unix.com/user_avatar/community.unix.com/juan.brein/32/7930_2.png) [@juan.brein](https://community.unix.com/u/juan.brein)\
**Post date:** [May 5, 2012, 12:02am UTC](https://community.unix.com/t/mailx-with-attachment/308924/4 "2012-05-05T00:02:43Z")

</div>

I had the same need time ago. I tried with mailx but it didn't work with a lot of files I wanted to send in an automated way. I finally installed mutt:

Look for in in sunfreeware  
Si very very powerful
