Why don't you use https://github.com/mikel/mail ? That's standard client, tested by millions of users, support gmail (see its wiki page).
There is no need to re-invent a wheel :-1: