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

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:

              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 = “
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?

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

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

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.

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.