- 论坛徽章:
- 0
|
5可用积分
同样的一段代码,偶在本地机器上(win-xp),和远程服务器(win-2k Server)上运行,
在服务器上就直接发出了mail;
而本地报错:
connect() failed: A socket operation was attempted to an unreachable network
我的程序代码如下:
- use Mail::Sender;
- my $sender = new Mail::Sender {
- smtp => 'smtp.163.com',
- from => 'daniel0528@163.com',
- auth => 'LOGIN',
- authid => 'daniel0528',
- authpwd => '123456',
- on_errors => undef,
- } or die "Can't create the Mail::Sender object: $Mail::Sender::Error\n";
- $sender->MailFile({to => 'lankang0528@163.com',
- subject => 'Here is the testing file',
- msg => "I'm sending you the list you wanted.",
- file => 'mail.txt'})or print $Mail::Sender::Error;
- $sender ->Close();
- print $Mail::Sender::Error eq "" ? "send ok!\n" : $Mail::Sender::Error;
复制代码
请问各位是不是在XP上不能发Mail啊,或者需要相关的系统配置修改?
XP能否实现上述代码?
[ 本帖最后由 不死草 于 2008-5-29 08:56 编辑 ] |
最佳答案
查看完整内容
试着traceroute smtp.163.com看看经过那些点..然後每个点去问一下......看为什麽没办法连..我个人认为你们可能有设定transparent proxy..或有fire wall所以不通......telnet xxx 25 主要是要模拟smtp连上mail server的动作...
|