PHP模拟SMTP发送邮件的类
PHP模拟SMTP发送邮件的类
<?php
/*********************************************************
filename:mail.class.php
describe:邮箱的配置,经测试可以适用于Linux和windows
function:检查邮箱的合法性,发送基本的邮箱验证信息
author: etongchina@gmail.com
time: 2008-03-06 20:15
checked: 2008-03-11 01:03
*********************************************************/
class SEND_MAIL{
/* Public Variables */
public $smtp_port;
public $from;
public $time_out;
public $host_name;
public $log_file;
public $relay_host;
public $debug;
public $auth;//需要auth身份验证吗?
public $user;
public $pass;
private $sock;
//给类变量赋值 定义构造器
public function __construct($auth = FALSE)
{
$this->debug = FALSE;
$this->relay_host = "smtp.163.com";//服务器名称
$this->smtp_port = 25;//服务器端口 默认为25 yahoo.cn为465
$this->time_out = 30; //is used in fsockopen() 默认:30s #
$this->auth = $auth;
$this->from = "zhoufeng0128@163.com
";
$this->user = "zhoufeng0128";//邮箱用户名
$this->pass = "XXXX"; //邮箱密码
$this->host_name = "localhost"; //is used in HELO command
$this->log_file = "";
$this->sock = FALSE;
}
/* Main Function */
function sendmail($to, $from, $subject = "", $body = "", $mailtype, $cc = "", $bcc = "", $additional_headers = ""){
$mail_from = $this->get_address($this->strip_comment($from));
$body = ereg_replace("(^|(\r\n))(\.)", "\1.\3", $body);
$header .= "MIME-Version:1.0\r\n";
if($mailtype=="HTML"){
$header .= "Content-
相关文档:
作者:samisa
以下文中的翻译名称对照表
:
payload: 交谈内容
object: 实例
function: 函数
使用
php来实现网络服务
使用框架:
WSO2
WSF/PHP
安装环境:
windows
或者
linux
(厌恶于眼下计算机文章夹杂无数难懂的翻译以及术语,此处尽量使用口语以及汉语。)
WSMessages 类:
在调用网络服务的过程中,需 ......
方法一:建一个拼音表 t_cosler ,存放每个字母开头的第一个汉字的编号和最后一个汉字的编号。
BatchFile code+------+--------+-------+
| f_PY | cBegin | cEnd |
+------+--------+-------+
| A | 45217 | 45252 |
| B | 45253 | 45760 |
.....
| Z | 54481 | 55289 |
+------+--------+-------+
......
Show All 1 2 3 4 5
本文由Michael原创和整理,转载请保留出处!http://www.toplee.com/blog/?p=100
Trackback URL: http://www.toplee.com/blog/wp-trackback.php?p=100
对于本文中出现的错误导致您的损失,Michael不承担责任。
前一段时间完成了服务器从FreeBSD4.10到6.1的升级,同时把PHP也升级到了最新的 ......
本篇文章来源于 黑客基地-全球最大的中文黑客站 原文链接:http://hackbase.com/tech/2009-08-04/54550_1.html
2007年11月01日 星期四 下午 03:48让我们以一个简单的例子开始---一个接收输入字符串,处理并返回这个字符串到客户端的TCP服务.下面是相应的代码:PHP 代码: ------------------------------------------------ ......
国外的开源技术也影响和推动了国内开源程序的发展,国外优秀开源PHP建站程序一览中,很多国外开源程序并不太符合中国人的使用习惯,而国内有一些厂家或个人也做了一些不错的产品,不少程序是提供源代码下载的,虽然有些在许可协议上和开源许可证有些出入,但其在使用上还是挺符合中国人的使用习惯,今天我就介绍一些国内的PHP&rdqu ......