phpphpmailer
Ⅰ 采用phpMailer发邮件出现错误怎样解决
原因是163邮箱开启了反垃圾邮件政策,抄送一份发送邮件就可以了。
Ⅱ phpmailer怎么使用
我这里有一个写好了的代码,我也是一直在用的例子:网络网盘的,你自己下。 解压后将文件夹mail里面有个mail.php,你打开这个文件,里面有需要配置的参数,你配置好了,就用浏览器访问这个文件,然后进邮箱看看就知道有没有邮件了。
Ⅲ php通过phpmailer发送一个8MB大小的sql文件到自己的邮箱,失败了
附件太大了,建议拆分后发送
Ⅳ php里的phpmailer类库,如何发送一个大文件附件
电子邮件本身就不支持这么大的附件。
分卷压缩发送出去。
大附件功能其实是把文件上传到云端,然后生成地址,收邮件的人通过地址到云端取回来。
Ⅳ 如何用PHPMailer接收邮件
现以中文版Outlook Express 4.0 为例进行设置:(一次设置长期可用) 1.单击窗口中的“工具/帐号”选项打开窗口; 2.在窗口中点击“邮件”标签; 3.单击“添加”按钮,选择“邮件”选项; 4.在输入姓名窗口中,输入您的用户名,单击“下一步”按钮; 5.输入您在中国工商报网邮件中申请的电子邮件地址,如:[email protected]; 6.在“电子邮件服务器名”窗口中设置邮件服务器; 7.选择接收邮件服务器为“POP3”; 8.在接收服务器下输入中国工商报网邮件的POP3服务器名称:211.100.8.31 9.在发送邮件的服务器中,您可以输入本地的发件服务器,也可以输入中国工商报网邮件的发件服务器名称:211.100.8.31 设置完成后, 单击“下一步”按钮; 10.在登录窗口选择登录方式,输入POP帐号名,如邮箱是[email protected],帐号名(用户名)是yourname; 11.输入密码,密码一般为星号显示。如果您没有输入密码,系统会在接收邮件时会提示输入密码。单击“下一步”按钮; 12.输入Internet Mail帐号名(用户名),您可以采用系统默认名称,也可以修改; 13.单击“完成”按钮完成添加。 您可以单击窗口中的“发送接收”进行收发邮件。
Ⅵ phpmailer到底怎么用
你看下第一个例子的代码
require("class.phpmailer.php");//这个就是包含你下载的phpmailer类的网页,必须
$mail = new phpmailer();//创建对象
$mail->From = "[email protected]";//给对象的属性赋值,就是发件人的邮箱地址
$mail->FromName = "List manager";//发件人的名称
$mail->Host = "smtp1.example.com;smtp2.example.com";//邮件主机的smtp地址
$mail->Mailer = "smtp";
//下面是邮件内容要用到的代码
@MYSQL_CONNECT("localhost","root","password");
@mysql_select_db("my_company");
$query = "SELECT full_name, email,爌hoto焖ROM employee燱HERE爄d=$id";
$result =燖MYSQL_QUERY($query);
while ($row = mysql_fetch_array ($result))
{
// HTML body
$body = "Hello <font size=\"4\">" . $row["full_name"] . "</font>, <p>";
$body .= "<i>Your</i> personal photograph to this message.<p>";
$body .= "Sincerely, <br>";
$body .= "phpmailer List manager";
// Plain text body (for mail clients that cannot read HTML)
$text_body = "Hello " . $row["full_name"] . ", \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "phpmailer List manager";
//上面就是你邮件要发送的内容,修改成自己的就可以了
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($row["email"], $row["full_name"]);//注意这个就是收件人,
$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())//开始发送
echo "There has been a mail error sending to " . $row["email"] . "<br>";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
}
以上用到的属性方法可以查看class.phpmailer.php的代码,很容易知道是干什么的。下的包里也应该有简单的例子,可以看下。
用法看下面的例子,不就是一个类嘛。
Examples using phpmailer
1. Advanced Example
This demonstrates sending out multiple email messages with binary attachments from a MySQL database with multipart/alternative support.
require("class.phpmailer.php");
$mail = new phpmailer();
$mail->From = "[email protected]";
$mail->FromName = "List manager";
$mail->Host = "smtp1.example.com;smtp2.example.com";
$mail->Mailer = "smtp";
@MYSQL_CONNECT("localhost","root","password");
@mysql_select_db("my_company");
$query = "SELECT full_name, email,爌hoto焖ROM employee燱HERE爄d=$id";
$result =燖MYSQL_QUERY($query);
while ($row = mysql_fetch_array ($result))
{
// HTML body
$body = "Hello <font size=\"4\">" . $row["full_name"] . "</font>, <p>";
$body .= "<i>Your</i> personal photograph to this message.<p>";
$body .= "Sincerely, <br>";
$body .= "phpmailer List manager";
// Plain text body (for mail clients that cannot read HTML)
$text_body = "Hello " . $row["full_name"] . ", \n\n";
$text_body .= "Your personal photograph to this message.\n\n";
$text_body .= "Sincerely, \n";
$text_body .= "phpmailer List manager";
$mail->Body = $body;
$mail->AltBody = $text_body;
$mail->AddAddress($row["email"], $row["full_name"]);
$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
if(!$mail->Send())
echo "There has been a mail error sending to " . $row["email"] . "<br>";
// Clear all addresses and attachments for next loop
$mail->ClearAddresses();
$mail->ClearAttachments();
}
2. Extending phpmailer
Extending classes with inheritance is one of the most powerful features of object-oriented programming. It allows you to make changes to the original class for your own personal use without hacking the original classes. Plus, it is very easy to do. I've provided an example:
Here's a class that extends the phpmailer class and sets the defaults for the particular site:
PHP include file: mail.inc.php
require("class.phpmailer.php");
class my_phpmailer extends phpmailer {
// Set default variables for all new objects
var $From = "[email protected]";
var $FromName = "Mailer";
var $Host = "smtp1.example.com;smtp2.example.com";
var $Mailer = "smtp"; // Alternative to IsSMTP()
var $WordWrap = 75;
// Replace the default error_handler
function error_handler($msg) {
print("My Site Error");
print("Description:");
printf("%s", $msg);
exit;
}
// Create an additional function
function do_something($something) {
// Place your new code here
}
}
Now here's a normal PHP page in the site, which will have all the defaults set above:
Normal PHP file: mail_test.php
require("mail.inc.php");
// Instantiate your new class
$mail = new my_phpmailer;
// Now you only need to add the necessary stuff
$mail->AddAddress("[email protected]", "Josh Adams");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip"); // optional name
if(!$mail->Send())
{
echo "There was an error sending the message";
exit;
}
echo "Message was sent successfully";
上面2个就是简单的例子啊!你照着改改就是了
Ⅶ php mailer发送邮件
$mail->Host = "smtp.126.com"; //必填,设置SMTP服务器
$mail->Username = ""; //必填,自己的邮箱地址,如[email protected]
$mail->Password = ""; // 必填 自己的邮箱密码
Ⅷ 如何用Phpmailer收取邮件 - 技术问答
我试了phpmailer2.3和5.0发信都是同一个问题,为什么用phpmailer成功发送的邮件都收不到? (试过163,21cn,tom,hotmail等都收不到)
Ⅸ 如何用php结合phpmailer发送邮件
步骤图解教程demo和
phpmailer代码包下载:
看这个博主的文章,新手也能实现php发送邮件:网页链接