# Error message "broken pipe" when sending email from Sandboxed app

**URL:** <https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664>\
**Category:** General\
**Created:** [March 6, 2020, 8:01am UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664 "2020-03-06T08:01:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 6, 2020, 8:01am UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664/1 "2020-03-06T08:01:50Z")

</div>

Since time immemorial my app has been sending emails to me for error reporting. I’ve been using SendGrid to send those emails now for a couple of years. Yesterday I tried to do that in the Sandboxed version of my app. Every time I try to send an email I get “broken pipe”. With more detail:

```
            getEncodedBody:
              Error sending on socket (1)
              socketErrno: 32
              socketError: Broken pipe
              send_size: 287
              Failed to send TLS message.
              Failed to write bytes.

```

My app accesses IMAP accounts and can download from the internet so I hope it’s not some additional security stupidity. I’ve tried to do some goggling but wasn’t successful in finding anything related. I’m sending the email with the Chilkat plugin. The relevant parts of the code are:

[code]mailman = New Chilkat.MailMan

'do the smtp details  
mailman.SmtpHost = “[smtp.sendgrid.net](http://smtp.sendgrid.net)”  
mailman.SmtpUsername = app.GetMore  
mailman.SmtpPassword = app.GetSocket  
mailman.SmtpSsl = True  
mailman.SmtpPort = 465  
Mailman.ConnectTimeout = 60  
Mailman.ReadTimeout = 60

// populate the email message to company  
Dim MailToCompany As New Chilkat.Email  
MailToCompany.fromAddress = “\<”+ TFEmailAddressText.Trim + “\>”  
MailToCompany.subject = “Error Report”

CkoMailTask = mailman.SendEmailAsync(MailToCompany)  
success = CkoMailTask.Run()[/code]

Does anyone have an idea what might cause the broken pipe?

---

<div class="post-metadata">

**Author:** ![DerkJ](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@DerkJ](https://forum.xojo.com/u/DerkJ)\
**Post date:** [March 6, 2020, 8:14am UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664/2 "2020-03-06T08:14:24Z")

</div>

Sigpipe signal is given, it means the socket is closed on the client side before everything is completed. Perhaps set timeout higher?

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 6, 2020, 8:32am UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664/3 "2020-03-06T08:32:00Z")

</div>

The timeout is 60 seconds. The attachments are really small. For the non-MAS version I have way more attachments and everything works fine.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 6, 2020, 8:34am UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664/4 "2020-03-06T08:34:47Z")

</div>

The attachments must be the problem. I have another functionality where an email is sent without an attachment. After enabling that functionality for the MAS version the email is sent.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 6, 2020, 9:08am UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664/5 "2020-03-06T09:08:24Z")

</div>

Cough… developer error… cough. The email was trying to attach files that weren’t supposed to be attached. The email became too large. The error message was just less than optimal.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:18pm UTC](https://forum.xojo.com/t/error-message-broken-pipe-when-sending-email-from-sandboxed-app/52664/6 "2021-04-29T16:18:40Z")

</div>


