2011-03-01 4 views
2

나는 사람들의 목록에 이메일을 보낼 스크립트를 작성 중이고이 이메일에는 첨부 파일이있을 것입니다. 나는이 문제에 대해 계속 실행포니 젬으로 Ruby에서 첨부 파일이있는 이메일 보내기

:
/usr/local/lib/ruby/1.9.1/net/smtp.rb:942:in 'check_response': 552 sorry, that message size exceeds my databytes limit (#5.3.4) (Net::SMTPFatalError)

첨부 파일 만 1백10킬로바이트

코드 :

Pony.mail(
     :to => to, 
     :from => 'Me <[email protected]>', 
     :subject => html_entity_decoder.decode(options[:subject]), 
     :html_body => "#{options[:body]}".html_safe, 
     :attachments => {File.basename("#{attachment}") => File.read("#{attachment}")}, 
     :headers => { "Content-Type" => "multipart/mixed", "Content-Transfer-Encoding" => "base64", "Content-Disposition" => "attachment" }, 
     :via => :smtp, 
     :via_options => { 
      :address  => ADDRESS, 
      :port   => '25', 
      :enable_starttls_auto => true, 
      :user_name  => USERNAME, 
      :password  => PWD, 
      :authentication => :plain, 
      :domain   => DOMAIN 
      } 
    ) 

잘못 될 수 있는지에 대한 어떤 생각?

답변

4

보내는 사서함에 공간이 부족하다는 메시지가 표시됩니다. 552 청구 메일 작업 중단 : 다음에 설명 RFC http://www.ietf.org/rfc/rfc2821.txt 초과 스토리지 할당

오류는 SMTP 에러이다.

그래서 메일 박스가 꽉 찼거나 당신이

+0

흠 ... 이상하다 ... 내 Gmail 계정에서 나에게 테스트 이메일을 보내고있다. 거기에 방 수가있다. 나는 SMTP 포트를 587 (기본값) 대신 25로 변경했고, 이제는 실행 만기 된 오류가 발생하고있다 ... – dennismonsewicz

+0

서버의 테스트 머신, 설치 프로그램이 뭐지? – macarthy

+0

나는 로컬에서 테스트 중입니다 ... 서버에 넣고 무슨 일이 일어날 지 알 것입니다 ... – dennismonsewicz

1

아마이 문제를 해결할 것이

:attachments => {File.basename("#{attachment}") => File.read("#{attachment}")}, 
    :headers => { "Content-Type" => "multipart/mixed", "Content-Transfer-Encoding" => "base64", "Content-Disposition" => "attachment" } 

을 사용하십시오에 맞지 않는 일을 보내는 중.