Simple wrapper around imap and mailparser that fetches, parses, and returns the most recent email that has been received by a gmail account.
Simply require in
last-gmail, pass in the account details (only
password are required, all other are optional and are documented here), and call
getLastEmail. The function returns the results, and any errors, in the callback param.
var gmail = ;var opts =user: 'firstname.lastname@example.org'password: 'password';gmail;