# problem with attachment mailpro plugin

**URL:** <https://forum.servoy.com/t/problem-with-attachment-mailpro-plugin/16351>\
**Category:** Classic Servoy\
**Created:** [August 16, 2012, 6:58am UTC](https://forum.servoy.com/t/problem-with-attachment-mailpro-plugin/16351 "2012-08-16T06:58:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefaniacolombara](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@stefaniacolombara](https://forum.servoy.com/u/stefaniacolombara)\
**Post date:** [August 16, 2012, 6:58am UTC](https://forum.servoy.com/t/problem-with-attachment-mailpro-plugin/16351/1 "2012-08-16T06:58:07Z")

</div>

hi, i have a problem with attacchment mailpro plugin.

I have this code:

var vFilePath = ‘c:/devlist.txt’;  
var vAttachment = plugins.MailPro.TextAttachment(vFilePath);  
vNewMessage = vSmtp.createMessage(‘xxxr@gmail.com’, ‘xxx@gmail.com’, ‘A test message’, vAttachment.name);  
vSuccess = vSmtp.sendMessage(vNewMessage);

but the mail does not send the attachment, nel corpo viene scritto il nome del file!!

how to send mail with attachments??  
tnk…

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [August 16, 2012, 7:21am UTC](https://forum.servoy.com/t/problem-with-attachment-mailpro-plugin/16351/2 "2012-08-16T07:21:40Z")

</div>

I’m not really familiar with the mailpro plugin, but it doesn’t seem correct to me that you use vAttachment.name in the createMessage call.

---

<div class="post-metadata">

**Author:** ![stefaniacolombara](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@stefaniacolombara](https://forum.servoy.com/u/stefaniacolombara)\
**Post date:** [August 16, 2012, 1:22pm UTC](https://forum.servoy.com/t/problem-with-attachment-mailpro-plugin/16351/3 "2012-08-16T13:22:30Z")

</div>

thanks for reply…  
I solved this by inserting instructions before sending the mail:

vNewMessage.addAttachment(vAttachment)

// Send the message  
vSuccess = vSmtp.sendMessage(vNewMessage);
