dcparker / ruby-gmail

A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
http://dcparker.github.com/ruby-gmail
790 stars 123 forks source link

Attachments sent but not received #54

Closed Dreyfuzz closed 10 years ago

Dreyfuzz commented 10 years ago

Using add_file, I have many recipients that are saying they did not receive the attached file. The attachment appears in the sent file on my gmail server. It appears that gmail accounts and certain other mail providers receive attachments fine, because when testing I did not encounter any problems. One recipient forwarded the email to another account and was able to open the attachment. Here is my code, perhaps someone can make sense of this.

require 'csv'
require 'gmail'

Gmail.new('email','password') do |gmail|
    CSV.foreach("/Users/teacher/Desktop/merge.csv") do |row|
        gmail.deliver do
            to row[5]
            subject "Report for #{row[1]} #{row[0]}"
            html_part do
                content_type 'text/html; charset=UTF-8'
                body "html body"
            end
            add_file row[4]
        end
    end
end
myobie commented 10 years ago

I can't reproduce this. I'm closing for now. If this happens then please open a new issue.

Dreyfuzz commented 10 years ago

Could I have hit Gmail's SMTP/IMAP limits?

https://support.google.com/a/answer/166852?hl=en

It doesn't seem to apply, because I sent separate messages to separate recipients.