Sendmail API changes + basic tests

OAuth fix included.