【PHP发送邮件。该怎么解决】教程文章相关的互联网学习教程文章

使用pear:Net_SMTP类发送邮件的例子

require 'Net/SMTP.php';$host = '126.com';//smtp服务器的ip或域名$username= 'arcow';//登陆smtp服务器的用户名$password= 'secret';//登陆smtp服务器的密码$from = 'jbxue@126.com'; //谁发的邮件$rcpt = array('test@test.com', 'jbxue@126.com');//可设多个接收者$subj = "Subject: 你是谁\n";//主题$body = "test it";//邮件内容/* 建立一个类 */if (! ($smtp = new Net_SMTP($host))) { die("无法初始化类Net_SMTP!\n"...

phpmailer发送邮件类库

phpmailer 发送邮件类库 header('Content-Type: text/html; charset=utf-8');require("phpmailer/class.phpmailer.php"); error_reporting(E_ERROR);function smtp_mail ( $sendto_email, $subject, $body ,$att=array()) { $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "asdfasdfasdf.com"; $mail->Username = "asdfasdfasdfsd@com.cn"; $mail->Password = "234234234234234"; $mail->FromName = ...

PHP发送邮件

这是用开源项目PHPMailer实现邮件发送 ,先下载文件,我这里下载得是5.1得版本,然后把三个class.***.php文件放到项目文件下,我首先用得是gmail,但是失败了,问题是认证失败,后来用了QQ邮箱,发送成功。 require("class.phpmailer.php"); //下载的文件必须放在该文件所在目录$mail = new PHPMailer(); //建立邮件发送类$address ="youbinliu@126.com";$mail->IsSMTP(); // 使用SMTP方式发送$mail->Host = "smtp.qq.com"; // 您...

PHP使用SMTP发送邮件(PEAR)

PHPer 多数使用 mail 函数来发送邮件,但我们可以使用其他的 SMTP 服务器来发送,这里推荐使用 PEAR’s mail package 来发送邮件。 $subject = "This mail is sent from SMTP.";$mail_body = "This is the body of the mail which is sent using SMTP.";$from = "From: From Name <fromaddress@xpertdeveloper.com>"; $to = "To: To Name <toaddress@xpertdeveloper.com>"; $receiver = "toaddress@xpertdeveloper.com"; // S...

php中通过curlsmtp发送邮件的例子

/** 功能:邮件发送 url: http://bbs.it-home.org*/header("content-type:text/html;charset=utf-8"); $smtp = array( "url" => "邮箱SMTP服务器地址", "port" => "邮箱SMTP服务器端口", // 一般为25 "username" => "用户名", "password" => "密码", "from" => "发件地址", "to" => "收件地址", "subject" => "测试一下标题", "body" => "测试一下内容" ); $CRLF = "\r\n"; $test = ""; $curl = curl_init(); curl_setopt($curl, C...

使用phpmailer发送邮件的例子

require_once(dirname(__FILE__)."/../PHPMailer/class.phpmailer.php");//包含class.phpmailer.php/*** @param string $send_to_mail 目标邮件* @param stinrg $subject 主题* @param string $body 邮件内容* @param string $extra_hdrs 附加信息* @param string $username 收件人* @param string $replyname 回复人* @param string $replymail 回复地址* @return array(bealoon,string) 返回数组包括两个元素,bealoon表示是否成...

php使用phpMailer发送邮件的例子

require("phpmailer/class.phpmailer.php"); function smtp_mail( $sendto_email, $subject, $body, $extra_hdrs, $user_name){ $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "smtp.163.com"; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "xuchao842363331"; // SMTP user...

phpmail函数发送邮件及乱码解决方法

php代码中使用mail函数发送邮件,有时会有乱码,此时添加上具体的编码方法即可解决。完整代码。

phpmailer类发送邮件乱码解决方法

phpmailer类发送邮件时出现乱码,主要的原因在于编码不统一,这里为大家介绍一个简单的处理方法,有需要的朋友,可以看看。假如PHPMailer项目文件都是GBK2312的格式,那么在email.func.php文件中加入:$mail->CharSet = "gb2312";即可解决乱码的问题。 您可能感兴趣的文章: PHPMailer发送邮件的实例分享 phpmailer发送gmail邮件的例子 phpmailer发送网易126邮箱的例子 phpmailer发送yahoo邮件的例子 phpmailer类实现邮件群发的实例...

phpmailer发送邮件及实现密码找回功能的代码【图】

使用phpmailer进行邮件发送,并实现忘记密码找加功能的代码,有需要的朋友,可以参考下。实现如下功能: 1、根据邮件找回链接进入重置密码操作页面 。仅一周内、一次有效 2、重置密码 (也可以将密码发送直接登录) 1、生成邮件找回邮件您好! 根据您于 [" . date('Y-m-d H:m:s') . "] 提交的请求,本邮件将引导您重新设置 [" . $account . "] 的帐号密码。 如果您确认本次“重新设置密码”的请求是您自己提交的,请点这里完成重设...

phpmailer发送邮件中文乱码问题的解决方法总结

$mail = new PHPMailer();2:设置邮件的编码;$mail->Charset=UTF-8; 相信有不少朋友是设置成"GBK"或“GB2312”的,我开始也是,后来了解到Mail是国际化的,如果想在像Gmail等那样的国际化邮箱正确显示中文,请将编码设置为“UTF-8”; 3,:设置标题编码; 这里可能有人会问,都设置了邮件的编码了,还设置标题编码做什么。 如果您测试过多种邮箱,你会发现标题中文是乱码的,没错,即使您设置了 $mail->Charset="UTF-8"; 既然学习...

PHPMailer邮件类发送邮件举例(163邮箱)

为大家介绍一个PHPMailer发送邮件的例子,使用smtp.163.com作为发送时的smtp,有需要的朋友,可以参考下。1、下载PHPMailer文件包,PHPMailer邮件发送类V5.1下载地址。 2、确认服务器支持socket,查看是否支持sockets注意: socket 是属于PHP扩展部分,编译时必须给定一个用于./configure --enable-sockets 的配置选项。 3、把文件解压到你的web服务器目录下,调用类即可。说明:首先包含 class.phpmailer.php,然后创建对象,设置...

PHPMailer发送邮件中文附件名乱码的解决办法

$mail->AddAttachment($attach, $attach); 发送过去的附件文件名将会是乱码,如果不指定:$mail->AddAttachment($attach, $attach); 发送过去的文件名中的中文直接没有了,变成了“.txt”。 解决办法一 打开class.phpmailer.php,在大概第1007行左右,函数AddAttachment中,有一句://$filename = basename($path);if (false === strpos($path, ‘/’))$filename = $this->EncodeHeader($path);else$filename = $this->EncodeHeade...

PHPmailer发送邮件及乱码问题的解决

phpmailer邮件发送测试-bbs.it-home.org请你输入收信的邮箱地址:2、发邮件程序 send.php/*** PHPMailer邮件发送* Edit bbs.it-home.org*/require("class.phpmailer.php");$mail = new PHPMailer();$mail->CharSet = "gb2312"; // 这里指定字符集!如果是utf-8则将gb2312修改为utf-8$mail->Encoding = "base64";$address = $_POST['address'];$mail->IsSMTP(); // set mailer to use SMTP$mail->Host = "smtp.126.com"; // specify ...

php使用smtp发送邮件的实现代码

为大家举一个php使用smtp发送邮件的代码,简单实用,有需要的朋友,可以参考下。完整代码如下。'脚本学堂', //这里填写网站名称);$mail = Array ('state' => 1,'server' => 'smtp.abc.com','port' => 25,'auth' => 1,'username' => 'admin@abc.com','password' => '123456','charset' => 'gbk','mailfrom' => 'admin@abc.com');function sendmail($mail_to, $mail_subject, $mail_message) {global $mail, $bfconfig;date_default_...