本帖最后由 听老歌 于 2012-03-14 16:40 编辑 php邮件发送 php代码[code]1.php 2.//包含这个类文件 3.require_once ('email.class.php'); 4. //就是邮箱的密码 5.$stmppass='xxxxx'; 6.//这里面的一个true是表示使用身份验证,否则不使用身份验证.实例化这个类 7.$smtp = new smtp("smtp.163.com","25",true,"邮箱地址",$stmppass); 8.$smtp->debug =true;//是否显示发送的调试信息 9. 10.$sm...
by 听老歌 - php文档中心 - 2012-03-14 17:06:31 阅读(1373) 回复(1)
由于工作需要,做了一个php自动发送邮件的功能,为了以后可能需要,先简单记录一下
1. 下载专门为php发送邮件服务的包class.phpmailer,这个网上可以下载
2. 那么如何使用这个包发送邮件呢?
看代码:
[CODE:] require("class.phpmailer.php"); require_once("Name_Set.php"); $mail = new phpMailer(); //创建对象 $mail->IsMail(); //LINUX:用$mail->IsSMTP(); $mail->Host = "123.123.123.123"; //邮件发送服务器地址 $mail->SMTPAuth = true; // turn on SMTP authentication $mail->CharSet = "GB2312"; //字符集 $mail->Enc...
?php /* ********************************** phpSo MVC System * Mail 邮件发送类 Lastdate:2005-12-16 9:30 QQ:10433182(Monkey) Copyright:phpSo.Com ********************************** $mail = new email ( 'smtp', //smtp方式方式时填写'smtp',mail函数发送时填写'mail' //以下为smtp方式时需要填写的参数 'smtp.vip.bbn.cn', //邮箱smtp地址 'user', //邮箱帐户 'pass', //邮箱口令 '25', //端口,不填...
一个非常牛的,发送邮件的php 的类 好东西,和大家分享。 文件: class.imerl.smtp.rar 大小: 4KB 下载: 下载 . 类文件的最后的部分是实例化应用的例子。 可以参考啊。^_^。 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16928/showart_252013.html
php--下面这个类的功能则很强大,不但能发html格式的邮件,还可以发附件 checkEmail($addressArray[$i])==false) return false; } //--所有合法的email地址存入数组中 $this->mailTo = implode($addressArray, ","); return true; } /************************************************** 函数 setCC($inAddress) 设置抄送人邮件地址 参数 $inAddress 为包涵一个或多个邮件地址的字串,email地址变量, 使用逗号来分割多个邮件...
php5.x自带的mail函数需要操作系统的支持,在某些Web服务器上不能使用。 我们可以借用SMTP协议通过外部的邮件服务器发送邮件。目前较为稳定的可靠的php邮件发送库是phpMailer。 Gmai也支持SMTP协议,通过phpMailer可以发送Gmail邮件。 具体代码样例可以参见: http://www.jiani.info/2012/08/%E4%BD%BF%E7%94%A8phpphpmailer%E5%92%8Cgmail%E5%8F%91%E9%80%81%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6/ 注意:Gmail有账户保护机制...
公司有个系统是通过邮件进行报警的,但突然凌晨5点以后邮件就没有发送成功。后来手动去发送提示:Mailer Error: Language string failed to load: from_failed邮件地址;尝试了好几次,偶尔可以发送一次成功。然后登入发送的邮件箱却也都可以发送成功。网上查了很多资料都没找到具体原因,麻烦高手帮忙下
php发送邮件,解决乱码[code]php $to = "429517385@qq.com"; $date = date("Y年m月d日"); $header = 'MIME-Version: 1.0' . "\r\n"; $header .= 'Content-type: text/html; charset=utf-8' . "\r\n"; $header .= "To: $to \r\n"; $header .= 'From: 624159864@qq.com' . "\r\n"; $mailsubject = "=?UTF-8?B?".base64_encode($mailsubject)."?="; $mailsubject = "绿尔雅减肥...
$sendto = "[email]test@test.com.cn[/email]";
$subject=“test”;
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: website
我的php.ini设置如下: [mail function] ; For Win32 only. SMTP = pop3.126.com smtp_port = 110 sendmail_from = www1308@126.com ; For Win32 only. ========================================== 发送邮件时报错: Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in E:\wwwroot\hviemail\upload\includes\smtp_functions.php on line 30 ========================================== 以...