# How to send mail with EXCEL as attachment

**URL:** <https://techcommunity.softwareag.com/t/how-to-send-mail-with-excel-as-attachment/126103>\
**Category:** Feedback & ideas\
**Tags:** Discussions-on-this-Forum-System, New-User-Welcome-and-Introductions\
**Created:** [April 18, 2012, 7:29pm UTC](https://techcommunity.softwareag.com/t/how-to-send-mail-with-excel-as-attachment/126103 "2012-04-18T19:29:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xue\_liang](https://avatars.discourse-cdn.com/v4/letter/x/9dc877/32.png) [@xue\_liang](https://techcommunity.softwareag.com/u/xue_liang)\
**Post date:** [April 18, 2012, 7:29pm UTC](https://techcommunity.softwareag.com/t/how-to-send-mail-with-excel-as-attachment/126103/1 "2012-04-18T19:29:18Z")

</div>

Recently I just complet a module for generating an format excel and send it to user as attachment. The solution I choose is:

1. Generating an excel file in local server,and write data to the file.
2. Read the file from local and transfer it to binary
3. send the xls file to user with pub.client:smtp.  
   
As design, there is no need to generate a real file in local server but only generate it in binary. However, I don’t know how to do like this. if anyone have the idea, I appraciated for your point out.

Now I will show you the parameter setting when sending the Excel file with the methods:pub.client:smtp  
[ATTACH=CONFIG]848[/ATTACH]  
contenttype: application/vnd.ms-excel  
filename: report.xls  
encoding: base64  
charset: utf-8  
   
The following is the contenttype list for your reference:  
[URL][http://webdesign.about.com/od/multimedia/a/mime-types-by-content-type.htm[/URL]](http://webdesign.about.com/od/multimedia/a/mime-types-by-content-type.htm%5B/URL%5D)  
 ![smtp.jpg](https://global.discourse-cdn.com/techcommunity/original/2X/e/e67d46622a9d648275a9e485a8db024d39088a7d.jpeg)
