[PerlChina] 答复: 答复: send mail in windows VISTA

Steven Zhu stevenzyk at gmail.com
Tue Feb 19 01:09:07 PST 2008


我使用io::socket,实现了server和client之间的通信
目前碰的一个问题,从client这段发送命令到server这边,当同时又2个client发送指令到server上去的话,将会按照指令发送的先后依次执行,我希望做到,当正在执行时,又有指令发送到server上,同时也开始执行相应操作,而不是等前一个指令的操作全部完成后,才开始
简单的说,也就是希望可以同时收到不同client上传来的指令,server上同时执行这些指令操作


在08-2-13,Bruce Cheng <bruce1914 at gmail.com> 写道:
>
>  好的, 谢谢!
>
>
>
> *发件人:* china-pm-bounces+bruce1914=gmail.com at pm.org [mailto:
> china-pm-bounces+bruce1914=gmail.com at pm.org] *代表 *Prince Brave
> *发送时间:* 2008年2月13日 21:10
> *收件人:* china-pm at pm.org
> *主题:* Re: [PerlChina] 答复: send mail in windows VISTA
>
>
>
> 首先需要指出的是:gmail 所使用的端口不是默认的 SMTP 端口25, 而是端口465,而且也不是普通的smtp连接,而是带ssl的smtp
> (有关信信息在gmail的帮助中的邮件客户端设置可以看到)。
> 你可以在CPAN上搜索smtp ssl 等的模块。perl 核心模块中的Net::SMTP只支持sasl验证。
> 另外一个问题是:在认证之前你应该给smtp服务器发送一个ELHO命令,即先$smtp->hello(),然后才是$smtp-> auth();关于
> smtp协议的细节
> 你有时间的话可以看一下相关的rfc文档,可以在google搜索" smtp rfc ",这样你会对邮件发送的细节有个清楚的认识。
> Bruce Cheng 写道:
>
> 我的代码是这样写的:
>
>
>
> #! c:/perl/bin/perl.exe
>
>
>
> use Net::SMTP ;
>
>
>
> $smtp = Net::SMTP->new('smtp.gmail.com') or die "Error1 : $!\n" ;
>
>
>
> print $smtp->domain ;
>
>
>
> $smtp->auth('username', 'password')  or die "Error2 : $!\n";
>
> $smtp->mail('bruce1914 at gmail.com')  or die "Error3 : $!\n";
>
> $smtp->to('bruce1985cx at 163.com')  or die "Error4 : $!\n";
>
> $smtp->data() ;
>
>
>
> print $smtp ;
>
>
>
> $smtp->datasend("To: bruce1985cx at 163.com\n <bruce1985cx at 163.com%5Cn>") or
> die "Error5 : $!\n" ;
>
> $smtp->datasend("\n") ;
>
> $smtp->datasend("A simple test message\n") or die "Error 6: $!\n" ;
>
> $smtp->dataend()  or die "Error7 : $!\n";
>
>
>
> $smtp->quit ;
>
>
>
> 运行结果:
>
>
>
>   Error2 : No such file or directory
>
>   mx.google.com
>
>
>
> 我试了很多网上别人提供的代码都不行,不知道哪儿有问题。
>
>
>
> _______________________________________________
> China-pm mailing list
> China-pm at pm.org
> http://mail.pm.org/mailman/listinfo/china-pm
>



-- 
BR
Steven.zhu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/china-pm/attachments/20080219/f47d9348/attachment-0001.html 


More information about the China-pm mailing list