Basically the connection is being closed by the gmail SMTP server unexpectedly. Whatever error is causing that on the gmail server is also resulting in the mail attachment not being delivered to Amazon.
You could get more debug output by running the following from the command line
Code:
calibre-smtp -vv -r smtp.gmail.com --port 587 -u username -p password --attachment filename --subject "test mail" username@gmail.com yourkindleusername@kindle.com "this is a test mail"
This will use the same code to send mail via Gmail as the GUI. IN addition it will print out the SMTP session, which should give more info about the error.
You may have to send the mails repeatedly until you get a failure, since the problem seems to be intermittent.