Mime message with attachment turns as empty spam u

2019-09-07 14:17发布

问题:

I'm trying to write a small smtp client in c++ using libcurl. I managed to send simple text email quite easily, but I'm failing when it comes to attachment...

For some weird reason, with my current implementation, some messages are correctly sent and received like this one

http://hastebin.com/cifetowiya.scala

whereas others are constantly failing and transformed into an empty message, like this one

http://hastebin.com/mafemufaxu.go

I spent some time looking around but I can't find any reason for that. Any help would be more than welcome!

Thanks a lot!

Edit:

I found my problem. The mime message is correct, but too long, and was exceeding the size my lib was currently able to handle. I fixed it and it's now working like a charm. See here for more explanation: https://codereview.stackexchange.com/questions/140805/sending-email-using-libcurl-follow-up-2/144208#144208