libgmail失败 [英] libgmail failure

查看:68
本文介绍了libgmail失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有,


我一直在使用libgmail向我公司的夜间回归测试发送自动通知电子邮件

。昨晚这些电子邮件

开始失败,尽管python代码没有改变。我更新了

最新的libgmail,但这没有帮助。我已经直接登录到

电子邮件帐户,该帐户仍然正常工作。


我得到的错误是HTTP错误400 :错误请求当使用

gmailAccount.login()时。这并没有抛出异常,只打印错误的
。代码在尝试发送邮件时彻底崩溃。


这段代码已启动并运行了几个月,刚刚开始

昨晚失败了。有没有人知道发生了什么?


代码和错误如下(相当简短:-)


非常感谢,

James


代码:

------------------- -------------------------------------------------- ----------------------------------

def send(TO_LIST,SUBJECT,MESSAGE ):

GA = libgmail.GmailAccount(" xx **** @ gmail.com"," xxxxxxx")

试试:

打印登录

GA.login()

除了libgmail.GmailLoginFailure:

print" \\\
Login failed。 (错误的用户名/密码?)"

else:

print"登录成功。\ n"

for TO TO TOIST :

MSG = libgmail.GmailComposedMessage(RX,SUBJECT,MESSAGE)

如果GA.sendMessage(MSG):

print"消息成功发送到'%s`。 %RX

else:

打印无法发送消息。

------------ -------------------------------------------------- -----------------------------------------


输出:

------------------------------------- -------------------------------------------------- ----------------

登录

HTTP错误400:错误请求

登录成功。


未找到任何消息

Traceback(最近一次调用最后一次):

文件" C:\ project] \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ b文件C:\ project] \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ,SUB,MSG)

文件C:\projects \ physware \ testCases \PythonTestScri pts

\ SendEmail.py"第39行,在发送

如果GA.sendMessage(MSG):

文件C:\ project] \\\\\\\\\\\\\\ br />
第588行,在sendMessage中

U_ACTION_TOKEN:self._getActionToken(),

文件" C:\ project] \ physware \ testCases \ _PythonTestScripts \ libgmail.py",

第563行,在_getActionToken中

at = self._cookieJar._cookies [ACTION_TOKEN_COOKIE]

KeyError :''GMAIL_AT''

------------------------------------ -------------------------------------------------- -----------------

Hey all,

I''ve been using libgmail to send out automated notification emails for
my company''s nightly regression testing. Last night these emails
started failing, though the python code has not changed. I updated to
the latest libgmail, but that isn''t helping. I''ve logged in to the
email account directly, and the account is still working fine.

The error I get is "HTTP Error 400: Bad Request" when using
gmailAccount.login(). This doesn''t throw an exception, just prints
the error. The code crashes outright when it tries to send mail.

This code has been up and running for several months and just started
failing last night. Does anyone have an idea what''s going on?

The code and error follow (fairly short :-)

Thanks much,
James

Code:
-------------------------------------------------------------------------------------------------------
def send(TO_LIST,SUBJECT,MESSAGE):
GA = libgmail.GmailAccount("xx****@gmail.com","xxxxxxx" )
try:
print "Logging in"
GA.login()
except libgmail.GmailLoginFailure:
print "\nLogin failed. (Wrong username/password?)"
else:
print "Log in successful.\n"
for RX in TO_LIST:
MSG = libgmail.GmailComposedMessage(RX,SUBJECT,MESSAGE)
if GA.sendMessage(MSG):
print "Message successfully sent to `%s` ." % RX
else:
print "Could not send message."
-------------------------------------------------------------------------------------------------------

Output:
-------------------------------------------------------------------------------------------------------
Logging in
HTTP Error 400: Bad Request
Log in successful.

No messages found
Traceback (most recent call last):
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 58, in <module>
main()
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 55, in main
send(TO_LIST,SUB,MSG)
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 39, in send
if GA.sendMessage(MSG):
File "C:\projects\physware\testCases\PythonTestScripts\ libgmail.py",
line 588, in sendMessage
U_ACTION_TOKEN: self._getActionToken(),
File "C:\projects\physware\testCases\PythonTestScripts\ libgmail.py",
line 563, in _getActionToken
at = self._cookieJar._cookies[ACTION_TOKEN_COOKIE]
KeyError: ''GMAIL_AT''
-------------------------------------------------------------------------------------------------------

推荐答案

On 21 Ago,23:07, " james.pn .. @ gmail.com" < james.pn .. @ gmail.com>

写道:
On 21 Ago, 23:07, "james.p.n...@gmail.com" <james.p.n...@gmail.com>
wrote:

嘿所有,


我一直在使用libgmail向我公司的夜间回归测试发送自动通知电子邮件

。昨晚这些电子邮件

开始失败,尽管python代码没有改变。我更新了

最新的libgmail,但这没有帮助。我已经直接登录到

电子邮件帐户,该帐户仍然正常工作。


我得到的错误是HTTP错误400 :错误请求当使用

gmailAccount.login()时。这并没有抛出异常,只打印错误的
。代码在尝试发送邮件时彻底崩溃。


这段代码已启动并运行了几个月,刚刚开始

昨晚失败了。有没有人知道发生了什么?


代码和错误如下(相当简短:-)


非常感谢,

James


代码:

------------------- -------------------------------------------------- ------ * ----------------------------

def send(TO_LIST,SUBJECT, MESSAGE):

GA = libgmail.GmailAccount(" xxx ... @ gmail.com"," xxxxxxx")

试试:

打印登录

GA.login()

除了libgmail.GmailLoginFailure:

print" \\\
Login failed。 (错误的用户名/密码?)"

else:

print"登录成功。\ n"

for TO TO TOIST :

MSG = libgmail.GmailComposedMessage(RX,SUBJECT,MESSAGE)

如果GA.sendMessage(MSG):

print"消息成功发送到'%s`。 %RX

else:

打印无法发送消息。

------------ -------------------------------------------------- ------------- * ----------------------------


输出:

------------------------------------ --------------------------------------- * ---------- ------------------

登录

HTTP错误400:错误请求

登录成功。


未找到消息

Traceback(最近一次调用最后一次):

文件" C:\ projects \ phyware \ testCases \PythonTestScri pts

\ SendEmail.py",第58行,在< module>

main()

文件C:\projects \ physware \ testCases \PythonTestScri pts

\ SendEmail.py,第55行,主要内容
发送(TO_LIST,SUB,MSG)

文件C:\projects \ physware \ testCases \PythonTestScri pts

\ SendEmail.py",第39行,发送

,如果GA.sendMessage(MSG):

文件C:\ project] \ physware \ testCases \PythonTestScripts \ libgmail.py",

第588行,在sendMessage中

U_ACTION_TOKEN:self._getActionToken(),

文件C:\ project:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ _cookieJar._cookies [ACTION_TOKEN_COOKIE]

KeyError:''GMAIL_AT''

--------------------- -------------------------------------------------- ---- * ----------------------------
Hey all,

I''ve been using libgmail to send out automated notification emails for
my company''s nightly regression testing. Last night these emails
started failing, though the python code has not changed. I updated to
the latest libgmail, but that isn''t helping. I''ve logged in to the
email account directly, and the account is still working fine.

The error I get is "HTTP Error 400: Bad Request" when using
gmailAccount.login(). This doesn''t throw an exception, just prints
the error. The code crashes outright when it tries to send mail.

This code has been up and running for several months and just started
failing last night. Does anyone have an idea what''s going on?

The code and error follow (fairly short :-)

Thanks much,
James

Code:
---------------------------------------------------------------------------*----------------------------
def send(TO_LIST,SUBJECT,MESSAGE):
GA = libgmail.GmailAccount("xxx...@gmail.com","xxxxxxx" )
try:
print "Logging in"
GA.login()
except libgmail.GmailLoginFailure:
print "\nLogin failed. (Wrong username/password?)"
else:
print "Log in successful.\n"
for RX in TO_LIST:
MSG = libgmail.GmailComposedMessage(RX,SUBJECT,MESSAGE)
if GA.sendMessage(MSG):
print "Message successfully sent to `%s` ." % RX
else:
print "Could not send message."
---------------------------------------------------------------------------*----------------------------

Output:
---------------------------------------------------------------------------*----------------------------
Logging in
HTTP Error 400: Bad Request
Log in successful.

No messages found
Traceback (most recent call last):
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 58, in <module>
main()
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 55, in main
send(TO_LIST,SUB,MSG)
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 39, in send
if GA.sendMessage(MSG):
File "C:\projects\physware\testCases\PythonTestScripts\ libgmail.py",
line 588, in sendMessage
U_ACTION_TOKEN: self._getActionToken(),
File "C:\projects\physware\testCases\PythonTestScripts\ libgmail.py",
line 563, in _getActionToken
at = self._cookieJar._cookies[ACTION_TOKEN_COOKIE]
KeyError: ''GMAIL_AT''
---------------------------------------------------------------------------*----------------------------



Don不知道是不是出于同样的原因,因为我不记得

错误是否相同,但有些时候我有类似的问题。

我使用libgmail从google邮箱复制大量邮件到

另一个我已经black-l isted"经过一段时间的洪水。

之后,我无法从浏览器访问我的帐户

a一定的时间(一两天)。 br />
尝试手动执行相同操作(通过使用浏览器尝试使用您的帐户登录

,然后发送邮件)并查看是否' '能够做到

所以。

Don''t know if it''s for the same reason since I can''t remember if the
error was the same, but some times ago I had a similar problem.
I used libgmail for copying a lot of mails from a google mail box to
another and I''ve been "black-listed" after a while for flooding.
After that I wasn''t neither able to access my account from browser for
a certain amount of time (one or two days).
Try to do same operation ''manually'' (by using a browser try to log-in
by using your account, then send a mail) and see if you''re able to do
so.


感谢你的建议。我已经尝试登录并手动发送电子邮件

它工作得很好。


非常感谢,

James

Thanks for the suggestion. I''ve tried logging in and sending email
manually and it works just fine.

Thanks though,
James


我现在遇到了同样的问题,詹姆斯,你有没有解决这个问题?


8月22日上午5:07,james.pn .. @ gmail.com < james.pn .. @ gmail.com>

写道:
I met the same problem now, James , do you have resolved this
problem ?

On Aug 22, 5:07 am, "james.p.n...@gmail.com" <james.p.n...@gmail.com>
wrote:

嘿所有,


我一直在使用libgmail向我公司的夜间回归测试发送自动通知电子邮件

。昨晚这些电子邮件

开始失败,尽管python代码没有改变。我更新了

最新的libgmail,但这没有帮助。我已经直接登录到

电子邮件帐户,该帐户仍然正常工作。


我得到的错误是HTTP错误400 :错误请求当使用

gmailAccount.login()时。这并没有抛出异常,只打印错误的
。代码在尝试发送邮件时彻底崩溃。


这段代码已启动并运行了几个月,刚刚开始

昨晚失败了。有没有人知道发生了什么?


代码和错误如下(相当简短:-)


非常感谢,

James


代码:

------------------- -------------------------------------------------- ----------------------------------

def send(TO_LIST,SUBJECT,MESSAGE ):

GA = libgmail.GmailAccount(" xxx ... @ gmail.com"," xxxxxxx")

试试:

打印登录

GA.login()

除了libgmail.GmailLoginFailure:

print" \\\
Login failed。 (错误的用户名/密码?)"

else:

print"登录成功。\ n"

for TO TO TOIST :

MSG = libgmail.GmailComposedMessage(RX,SUBJECT,MESSAGE)

如果GA.sendMessage(MSG):

print"消息成功发送到'%s`。 %RX

else:

打印无法发送消息。

------------ -------------------------------------------------- -----------------------------------------


输出:

------------------------------------- -------------------------------------------------- ----------------

登录

HTTP错误400:错误请求

登录成功。


未找到任何消息

Traceback(最近一次调用最后一次):

文件" C:\ project] \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ b文件C:\ project] \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ,SUB,MSG)

文件C:\projects \ physware \ testCases \PythonTestScri pts

\ SendEmail.py",第39行,发送

,如果GA.sendMessage(MSG):

文件C:\ project] \ physware \\ \\ testCases \PythonTestScripts \ libgmail.py",

第588行,在sendMessage中

U_ACTION_TOKEN:self._getActionToken(),

文件C:\ project] \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ _cookies [ACTION_TOKEN_COOKIE]

KeyError:''GMAIL_AT''

----------------------- -------------------------------------------------- ------------------------------
Hey all,

I''ve been using libgmail to send out automated notification emails for
my company''s nightly regression testing. Last night these emails
started failing, though the python code has not changed. I updated to
the latest libgmail, but that isn''t helping. I''ve logged in to the
email account directly, and the account is still working fine.

The error I get is "HTTP Error 400: Bad Request" when using
gmailAccount.login(). This doesn''t throw an exception, just prints
the error. The code crashes outright when it tries to send mail.

This code has been up and running for several months and just started
failing last night. Does anyone have an idea what''s going on?

The code and error follow (fairly short :-)

Thanks much,
James

Code:
-------------------------------------------------------------------------------------------------------
def send(TO_LIST,SUBJECT,MESSAGE):
GA = libgmail.GmailAccount("xxx...@gmail.com","xxxxxxx" )
try:
print "Logging in"
GA.login()
except libgmail.GmailLoginFailure:
print "\nLogin failed. (Wrong username/password?)"
else:
print "Log in successful.\n"
for RX in TO_LIST:
MSG = libgmail.GmailComposedMessage(RX,SUBJECT,MESSAGE)
if GA.sendMessage(MSG):
print "Message successfully sent to `%s` ." % RX
else:
print "Could not send message."
-------------------------------------------------------------------------------------------------------

Output:
-------------------------------------------------------------------------------------------------------
Logging in
HTTP Error 400: Bad Request
Log in successful.

No messages found
Traceback (most recent call last):
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 58, in <module>
main()
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 55, in main
send(TO_LIST,SUB,MSG)
File "C:\projects\physware\testCases\PythonTestScri pts
\SendEmail.py", line 39, in send
if GA.sendMessage(MSG):
File "C:\projects\physware\testCases\PythonTestScripts\ libgmail.py",
line 588, in sendMessage
U_ACTION_TOKEN: self._getActionToken(),
File "C:\projects\physware\testCases\PythonTestScripts\ libgmail.py",
line 563, in _getActionToken
at = self._cookieJar._cookies[ACTION_TOKEN_COOKIE]
KeyError: ''GMAIL_AT''
-------------------------------------------------------------------------------------------------------



这篇关于libgmail失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆