當前位置:首頁 » 編程語言 » phpphpmailer

phpphpmailer

發布時間: 2022-02-26 08:39:32

Ⅰ 採用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發送郵件:網頁鏈接

熱點內容
路由器重置了wifi默認密碼是什麼 發布:2025-01-11 02:03:55 瀏覽:659
2019速騰買什麼配置好 發布:2025-01-11 01:35:07 瀏覽:829
博越存儲異常 發布:2025-01-11 01:24:31 瀏覽:917
我的世界還原中國伺服器版圖 發布:2025-01-11 01:18:45 瀏覽:384
pythonopenasfile 發布:2025-01-11 01:17:06 瀏覽:973
hbasejavaapi 發布:2025-01-11 01:11:09 瀏覽:747
我的世界pe版飢餓伺服器 發布:2025-01-11 01:09:39 瀏覽:486
異構資料庫數據同步 發布:2025-01-11 01:09:04 瀏覽:957
c語言三角波 發布:2025-01-11 01:02:11 瀏覽:79
php正則轉義 發布:2025-01-11 01:00:03 瀏覽:692