最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
NT下基于邮件服务软件(IMAIL)的邮件发送程序--(网络版)
时间:2022-07-02 10:33:51 编辑:袖梨 来源:一聚教程网
如果你无法在服务器上安装IMAIL,那只能通过socket来发送邮件。但是如果你幸运的话,也可以用163/sina的
smtp服务。
例程如下(原程序由马毅兄提供):
>
Mail Form anywhere
if($sendit)
{
$smtpserver="202.110.200.242" ; //将此处设为IMAIL的IP
echo "
smtp服务。
例程如下(原程序由马毅兄提供):
>
if($sendit)
{
$smtpserver="202.110.200.242" ; //将此处设为IMAIL的IP
echo "
" ;
$fp = fsockopen($smtpserver, 25, &$errno, &$errstr, 10) ; //连接smtp服务器,端口25
if(!$fp) die("wrong open smtp SERVER") ;
$hostreplay=fgets($fp,128);
//if (!strstr($hostreplay,"220")) die(" can n't receive the 220 answer ") ;
$smailname=strstr(ltrim($hostreplay),"220 ") ;
$smailname=substr($smailname,0,strpos($smailname,".")) ;
//echo " smailname:$smailname " ;
fputs($fp,"$smailname ") ;
$hostreplay=fgets($fp,128);
//if (!strstr($hostreplay,"250")) die(" can n't receive the 250 answer ") ;
fputs($fp,"MAIL FROM: ") ;
$hostreplay=fgets($fp,128) ;
if (!strstr($hostreplay,"250")) {
fputs($fp,"MAIL FROM: root ") ;
$hostreplay=fgets($fp,128) ;
if (!strstr($hostreplay,"250")) {
fputs($fp,"MAIL FROM: [email protected] ") ;
echo($hostreplay=fgets($fp,128)) ;
if (!strstr($hostreplay,"250")) {
fputs($fp,"MAIL FROM: $from_address ") ;
$hostreplay=fgets($fp,128) ;
if (!strstr($hostreplay,"250")) die(" can n't receive the 250 answer ") ;
};
};
};
fputs($fp,"RCPT TO: $to_address ") ;
$hostreplay=fgets($fp,128);
if (!strstr($hostreplay,"250")) {
fputs($fp,"RCPT TO: $mailname ") ;
$hostreplay=fgets($fp,128) ;
if (!strstr($hostreplay,"250")) echo(" can n't receive the 354 answer") ;
相关文章
- 《侠客风云传》貔貅拳套获取方式 怎么获得吸蓝拳套 08-08
- 黑曜石《宣誓》采用非线性叙事:把选择权交给玩家! 08-08
- 无限暖暖满电行动任务攻略-无限暖暖满电行动任务怎么做 08-08
- 无限暖暖植物在哪采集-无限暖暖植物采集地点汇总 08-08
- 魔兽世界法力陵墓如何去-魔兽世界法力陵墓进去方法攻略 08-08
- 无尽梦回荆棘之梦怎么样-无尽梦回荆棘之梦优势详解 08-08