通过Gmail API从非主电子邮件地址发送

时间:2017-01-11 15:32:04

标签: javascript gmail gmail-api

问候Gmail API粉丝。

我编写了一些非常棒的代码,它使用带有JavaScript的Gmail API整齐地验证和发送电子邮件。

然而,即使脑子像我一样大,我也有问题。虽然使用import SortFilterProxyModel 0.2 // from https://github.com/oKcerG/SortFilterProxyModel import QtQml 2.2 /* ... */ ComboBox { id: control model: vehiclesModel delegate: ItemDelegate { contentItem: RowLayout { Image { source: imagePath } Label { text: name } } highlighted: control.highlightedIndex == index } contentItem: { currentIndex; return selectedInstantiator.object; } // use currentIndex to force the binding reevaluation. When the model changes, the instantiator doesn't notify object has changed Instantiator { id: selectedInstantiator model: SortFilterProxyModel { sourceModel: control.model filters: IndexFilter { minimumIndex: control.currentIndex maximumIndex: control.currentIndex } } delegate: RowLayout { Image { source: imagePath } Label { text: name } } } } 并将gapi.client.gmail.users.messages.send设置为userId时,电子邮件会完美发送,但我无法通过我与帐户关联的备用群组电子邮件地址发送电子邮件。

例如,如果我尝试将"me"更改为userId,即使该电子邮件地址与我的Gmail帐户相关联,也会执行401“需要登录”错误。

Settings screen

任何想法发生了什么?

下面是一段代码:

"myalternate@somewhere.com"

1 个答案:

答案 0 :(得分:0)

请勿更改网址路径中的“userId”。只需将电子邮件中的“发件人”标题设置为该地址(并且必须是Gmail帐户的经过验证的地址才能生效)。

相关问题