# SMTPClient error 554

**URL:** https://discourse.julialang.org/t/smtpclient-error-554/71360
**Category:** New to Julia
**Created:** [November 12, 2021, 1:59am UTC](https://discourse.julialang.org/t/smtpclient-error-554/71360 "2021-11-12T01:59:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sransome](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sransome/32/29810_2.png) [@sransome](https://discourse.julialang.org/u/sransome)
#### Post date: [November 12, 2021, 1:59am UTC](https://discourse.julialang.org/t/smtpclient-error-554/71360/1 "2021-11-12T01:59:54Z")

</div>

I’m using SMTPClient to send emails with csv attachments via office 365 and it’s largely working. However, when the attachment size is greater than about 10KB I get an error that crashes my code.

`ERROR: LoadError: curl_easy_perform() failed: Failure when receiving data from the peer`

I have also tried attaching an XLSX file but same issue. I’m assuming this is a mail server issue but is a change I can make on the client end to overcome this issue?

```fn
        CSV.write(fn, df)
opt = SendOptions(
            isSSL = true,
            username = "me@mydomain.com",
            passwd = "mypwd"
            ,verbose=true )
          url = "smtp.office365.com:587"
          message = string("the message string")
          subject = "the subject string" 
          to = ["<auser@adomain.org."]
          cc = ["<auser@live.com.au>"]
          bcc = ["<auser@adomain.com>"]
          from = "me@mydomain.com"
          replyto = "me@mydomain.com"
          attachments = [fn]
          mime_msg = get_mime_msg(message)
          body = get_body(to, from, subject, mime_msg; attachments)
          rcpt = vcat(to, cc, bcc)
          resp = send(url, rcpt, from, body, opt)

```

my code code errors on the last line.

Thanks  
Steve  
Windows 10, VSCode 1.62.1, Julia plugin 1.4.3 Julia 1.6.2

Here is the logging

- Trying 52.98.140.114:587…
- Connected to [smtp.office365.com](http://smtp.office365.com) (52.98.140.114) port 587 (#0)  
\< 220 [SY0PR01CA0012.outlook.office365.com](http://SY0PR01CA0012.outlook.office365.com) Microsoft ESMTP MAIL Service ready at Fri, 12 Nov 2021 01:18:37 +0000

> EHLO DESKTOP-QPUMVIR  
> \< [250-SY0PR01CA0012.outlook.office365.com](http://250-SY0PR01CA0012.outlook.office365.com) Hello [xxx.xxx.xxx.xxx]  
> \< 250-SIZE 157286400  
> \< 250-PIPELINING  
> \< 250-DSN  
> \< 250-ENHANCEDSTATUSCODES  
> \< 250-STARTTLS  
> \< 250-8BITMIME  
> \< 250-BINARYMIME  
> \< 250-CHUNKING  
> \< 250 SMTPUTF8  
> STARTTLS  
> \< 220 2.0.0 SMTP server ready

- schannel: added 138 certificate(s) from CA file ‘C:\Users\steve\AppData\Local\Programs\Julia-1.6.2\share\julia\cert.pem’
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) did not match against certificate name (\*.clo.footprintdns.com)
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) did not match against certificate name (\*.hotmail.com)
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) did not match against certificate name (\*.internal.outlook.com)
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) did not match against certificate name (\*.live.com)
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) did not match against certificate name (\*.nrb.footprintdns.com)
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) did not match against certificate name (\*.office.com)
- schannel: connection hostname ([smtp.office365.com](http://smtp.office365.com)) validated against certificate name (\*.office365.com)

> EHLO DESKTOP-QPUMVIR  
> \< [250-SY0PR01CA0012.outlook.office365.com](http://250-SY0PR01CA0012.outlook.office365.com) Hello [xxx.xxx.xxx.xxx]  
> \< 250-SIZE 157286400  
> \< 250-PIPELINING  
> \< 250-DSN  
> \< 250-ENHANCEDSTATUSCODES  
> \< 250-AUTH LOGIN XOAUTH2  
> \< 250-8BITMIME  
> \< 250-BINARYMIME  
> \< 250-CHUNKING  
> \< 250 SMTPUTF8  
> AUTH LOGIN  
> \< 334 VXNhbWU6  
> c3JhbnNAY3JlYXRpdmVzb2Z0d2Fb20uYXU=  
> \< 334 Uc3dvcmQ6  
> Y3NzSmFjazI1  
> \< 235 2.7.0 Authentication successful  
> MAIL FROM:[me@mydomain.com](mailto:me@mydomain.com)  
> \< 250 2.1.0 Sender OK  
> RCPT TO:[auser@adomain.org](mailto:auser@adomain.org)  
> \< 250 2.1.5 Recipient OK  
> RCPT TO:[auser@live.com](mailto:auser@live.com)  
> \< 250 2.1.5 Recipient OK  
> RCPT TO:[auser@adomain.com](mailto:auser@adomain.com)  
> \< 250 2.1.5 Recipient OK  
> DATA  
> \< 354 Start mail input; end with .  
> \< 554 5.6.0 Invalid message content when handling MIME exception. IMC53

- Connection #0 to host [smtp.office365.com](http://smtp.office365.com) left intact  
ERROR: LoadError: curl\_easy\_perform() failed: Failure when receiving data from the peer

```julia

```
