Created
August 17, 2014 03:30
-
-
Save AkashMartin1/20ab002e7f5785ae778e to your computer and use it in GitHub Desktop.
Gmail API Send message : ArgumentError: no method name given
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@email = @google_api_client.execute( | |
api_method: @gmail.users.messages.send, | |
parameters: { | |
userId: 'me', | |
message: { | |
raw: { | |
payload: { | |
body: { date: 'aGVsbG8=' }, | |
headers: [{ name: 'to', | |
value: '[email protected]'}, | |
{ name: 'from', | |
value: '[email protected]'}, | |
{ name: 'subject', | |
value: 'Hi'}], | |
mimeType: 'text/plain' | |
} | |
} | |
} | |
}, | |
headers: {'Content-Type' => 'application/json'} | |
) |
Where do you identify the body text?
Mail
instance then using the mightly to_s
method to encode works for me. Thanks for the notes.
I am facing the same problem. Could you please post a sample working code?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@gmail.users.messages.send(:get)