It seems that Google refuses to accept your mail. Usually that is because you haven't set up your domain to their liking, and/or are spamming too much.
I found that the response you get from the Google mail servers usually points you to the cause of the problem. I don't know how to make Net::SMTP return the response message from the remote server, so I can't help you much there except to turn on debugging:
$smtp = Net::SMTP->new('mailhost', Hello => 'my.mail.domain', Timeout => 30, Debug => 1, );
But maybe Google already dislikes you so much that they shut down your socket without telling you anything because they see in the first 8kb of your attachment that you are up to no good.
In reply to Re: email fails with attachments over 8kb
by Corion
in thread email fails with attachments over 8kb
by abrunskie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |