0
루비에서 구글-API 클라이언트 보석과 이메일에 파일 첨부 , 그러나 그것을하는 방법에 대한 예제를 찾을 수 없습니다. 보석 저장소에있는 example included은 그 사건을 설명하지 않습니다. 나는 리버스 엔지니어링을 시작했으나 거의 하루 종일 시도한 후에 미친 짓을 시작했다.나는 <code>google-api-client</code> 보석에 구글 API의 감사를 통해 이메일을 보낼 관리했습니다
upload = Google::Apis::Core::UploadIO.new('/path/to/image.png', 'image/png', 'image.png')
file_part = Google::Apis::Core::FilePart.new(nil, upload)
message_object = Google::Apis::GmailV1::Message.new(payload: file_part, raw: 'this is a test body')
service.send_user_message('me', message_object, content_type: 'message/rfc822')
이메일이 반송되었습니다
내 마지막 시도는 다음을이었다.
파일을 첨부하는 적절한 방법은 무엇입니까?