空间支持PHP但不支持MAIL函数,怎么办?
来源:百度知道 编辑:UC知道 时间:2024/05/03 11:37:15
郁闷了~~~
PHP一个发送邮件的类
现在很多主机空间都是IIS上执行PHP程序,大多不能直接用mail()发送邮件,有了这个类只要你有注册过邮箱,就可以随意的发送邮件,速度也不慢哦。
//******************************
// smtp.php文件
//
//******************************
<?php
class smtp
{
/* Public Variables */
var $smtp_port;
var $time_out;
var $host_name;
var $log_file;
var $relay_host;
var $debug;
var $auth;
var $user;
var $pass;
/* Private Variables */
var $sock;
/* Constractor */
function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass)
{
$this->debug = FALSE;
$this->smtp_port = $smtp_port;
$this->relay_host = $relay_host;
$this->time_out = 30; //is used in fsockopen()
#
$this->auth = $auth;//auth
$this->user = $user;
$this->pass = $pass;