我正在尝试使用 imap 库从 C++ 程序发送电子邮件。我有一个 Google Apps 和一个将电子邮件发送到的 Gmail 帐户。
每当程序无法发送电子邮件时,我都会将错误记录到文件中。
我将程序设置为循环运行以发送电子邮件。有时,我没有收到电子邮件,当我检查日志文件时,我发现每次发送电子邮件失败时都会记录这些错误。
这是日志文件的一部分:
[2012-04-23 11:04:34] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (2753 >= 1024)
[2012-04-23 11:04:34] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (2753 >= 1024)
[2012-04-23 11:05:36] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1692 >= 1024)
[2012-04-23 11:05:36] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1692 >= 1024)
[2012-04-23 11:07:52] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1605 >= 1024)
[2012-04-23 11:07:52] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1605 >= 1024)
[2012-04-23 11:08:02] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1566 >= 1024)
[2012-04-23 11:08:02] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1566 >= 1024)
[2012-04-23 11:08:09] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1067 >= 1024)
[2012-04-23 11:08:09] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1067 >= 1024)
[2012-04-23 11:08:19] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1648 >= 1024)
[2012-04-23 11:08:19] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1648 >= 1024)
[2012-04-23 11:08:20] ErrCode:1 ErrMsg:Unable to create selectable TCP socket (1130 >= 1024)
[2012-04-23 11:08:20] ErrCode:2 ErrMsg:Unable to create selectable TCP socket (1130 >= 1024)
它与imap服务器端口有关吗?如果是这样,它应该设置到哪个端口?总是993??如何解决此错误?
这是我的设置:
Name: Ashwin
my email: blahblah@wyswtf.com
reply-to-email: blahblah@wyswtf.com
SMTP 服务器信息:
Host: smtp.gmail.com
Encryption: SSL
Port: 465
该程序以 root 用户身份运行,我使用的库来自http://panda.com/imap/