【phpmailer的有关问题】教程文章相关的互联网学习教程文章

使用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表示是否成...

PHPMailer中文使用说明

PHPMailer 中文使用说明,有需要的朋友拿去咯。A开头: $AltBody --属性 出自:PHPMailer : $AltBody 文件:class.phpmailer .php 说明:该属性的设置是在邮件正文不支持HTML的备用显示 AddAddress --方法 出自:PHPMailer ::AddAddress(),文件:class.phpmailer .php 说明:增加收件人。参数1为收件人邮箱,参数2为收件人称呼。例AddAddress("to@163.com","to name"),但参数2可选,AddAddress(to@163.com )也是可以的。 函数原型...

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...

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邮件群发的范例参考

为大家介绍phpmailer邮件类进行群发的例子,即同时指定多个收件人,是phpmailer应用的不错的例子,有需要的朋友,可以参考下。PHPMailer群发邮件的例子, 代码如下:IsSMTP(); // send via SMTP$mail->Host = "smtp.163.com"; // SMTP servers$mail->SMTPAuth = true; // turn on SMTP authentication$mail->Username = "test123"; // SMTP username 注意:普通邮件认证不需要加 @域名$mail->Password = "123456"; // SMTP passwor...

phpmailer发邮件中文乱码问题如何解决

在用phpmailer发送中文内容的邮件时,经常出现乱码,本文给出一个例子,主要是加上了编码设置base64,可以解决乱码的问题,供大家参考。使用PHPMailer类发送邮件, 代码如下:IsSMTP();$mail->CharSet = "GB2312"; //chinese;$mail->Encoding = "base64";$mail->SMTPAuth = true;$mail->SMTPSecure = "ssl";$mail->Host = " smtp "; // set smtp server domain or ip;$mail->Port ...

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邮件群发的入门例子【图】

phpmailer是php编程中经常用得到的mail发送类,为大家介绍一个入门级的例子,用phpmailer进行邮件群发,有需要的朋友,可以参考下。1、创建smtp_mail函数 phpmai.phpIsSMTP(); // send via SMTP $mail->Host = $host; // SMTP servers $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username =$mailname; // SMTP username 注意:普通邮件认证不需要加 @域名 $mail->Password =$mailp...

PHPMailer邮件标题中文乱码的解决方法

/** * PHPMailer邮件发送 * Edit bbs.it-home.org*/ function smtp_main_send( $to, $subject, $message, $from, $fromName ) { $mail = new PHPMailer(); $mail->CharSet = "UTF-8"; // 设置编码 $mail->IsSMTP(); // 设置使用SMTP服务发送 $mail->Host = "smtp.mail.com"; $mail->Username = "user"; $mail->Password = "pass"; $mail->SMTPAuth = true; $mail->From = $from; $mail->FromName = $fromName; ...

PHPMailer收发邮件标题、发件人、内容乱码问题的终极解决方法

function EncodeHeader ($str, $position = text, $pl = 0) {if ( $pl ) return "=?" . $this->CharSet . "?B?" . base64_encode($str) . "?=";为这个函数多定义的一个参数。 自然要修改所有调用这个函数的地方的参数。 查找:EncodeHeader( 如下类似这样的都要改:$result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject))); 改成:$result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim...

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邮件发送 * Edit bbs.it-home.org*/require_once('include/PHPMailer/class.phpmailer.php'); //导入PHPMAILER类$mail = new PHPMailer(); //创建实例$mail -> CharSet='utf-8'; //设置字符集$mail -> SetLanguage('ch','include/PHPMailer/language/'); //设置语言类型和语言文件所在目录$mail -> IsSMTP(); //使用SMTP方式发送$mail -> SMTPAuth = true; //设置服务器是否需要SMTP身份验证$mail -> Host = SMTP_S...

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 ...

PHPMAILER - 相关标签