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 类:
在调用网络服务的过程中,需 ......
<?php
$filename
=
"
D:
\\
296.mid
"
;
$file
=
fopen
(
$filename
,
"
rb
"
)
;
$bin
=
fread
(
$file
,
2
)
;
//只读2字节
fclose
(
$file
)
;
$strInfo
= @
unpack
(
"
c2chars
" ......
linux中升级php和GD库笔记
php-5.1.2.tar.gz
安装php所需的软件包
(其中libxml2是安装php5必须的,为什么还需要perl呆会说明原因。)
libxml2-2.6.19.tar.gz
libxslt-1.1.15.tar.gz
ActivePerl-5.8.8.817-i686-linux-2.2.17-gcc-257965.rpm
curl-7.15.0.tar.gz
GD库所需要软件包
(有人说PHP源码包里自 ......
可以通过序列话一个数组,然后放到cookie中
从cookie中得到值,然后在反序列化,转换为数组。
$cur_goods_array = unserialize(stripslashes($_COOKIE['shop_cart_info']));
setcookie("shop_cart_info",serialize($cur_goods_array)); ......
1.冒泡排序
function m_sort($arr)
{
$l = count($arr);
if($l==0) return false;
for($i=0;$i<$l-1;$i++)
{
for($j=$i+1;$j<$l-1;$j++)
......