導航:首頁 > 編程語言 > php發送郵件配置

php發送郵件配置

發布時間:2022-08-28 04:10:49

1. php怎麼實現發送郵件

PHP發送郵件是「非常的簡單」 因為他提供了mail()函數直接發送,但配置相當麻煩 (1)通過mail()函數發送郵件 mail() 配置PHP.ini 郵件信息 需要類似sendmail這樣的組件支持 (2)通過socket通訊,使用SMTP傳輸 socket連接->SMTP通訊->獲取通訊消息->發送 mail函數的使用 mail() 函數允許您從腳本中直接發送電子郵件。 如果郵件的投遞被成功地接收,則返回 true,否則返回 mail(to,subject,message,headers,parameters) socket方式發送原理 給你一個別人寫好的類 用法在下面 本人經測試很多網站都不提供免費的smtp服務(126、sina、netease 這幾個試過了),騰訊郵箱支持此功能。 用法: <? require_once ('email.class.php'); //########################################## $smtpserver = "smtp.163.com";//SMTP伺服器 $smtpserverport =25;//SMTP伺服器埠 $smtpusermail = "";//SMTP伺服器的用戶郵箱 $smtpemailto = "";//發送給誰 $smtpuser = "";//SMTP伺服器的用戶帳號 $smtppass = "";//SMTP伺服器的用戶密碼 $mailsubject = "PHP100測試郵件系統";//郵件主題 $mailbody = "<h1> 這是一個測試程序 PHP100.com </h1>";//郵件內容 $mailtype = "HTML";//郵件格式(HTML/TXT),TXT為文本郵件 ########################################## $smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//這裡面的一個true是表示使用身份驗證,否則不使用身份驗證. $smtp->debug = FALSE;//是否顯示發送的調試信息 $smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype); ?> 郵件發送類 <? class smtp { /* Public Variables */ var $smtp_port; var $time_out; var $host_name; var $log_file; var $relay_host; var $debug; var $auth; var $user; var $pass; /* Private Variables */ var $sock; /* Constractor */ function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass) { $this->debug = FALSE; $this->smtp_port = $smtp_port; $this->relay_host = $relay_host; $this->time_out = 30; //is used in fsockopen() # $this->auth = $auth;//auth $this->user = $user; $this->pass = $pass; # $this->host_name = "localhost"; //is used in HELO command $this->log_file =""; $this->sock = FALSE; } /* Main Function */ function sendmail($to, $from, $subject = "", $body = "", $mailtype, $cc = "", $bcc = "", $additional_headers = "") { $mail_from = $this->get_address($this->strip_comment($from)); $body = ereg_replace("(^|(\r\n))(\\.)", "\\1.\\3", $body); $header .= "MIME-Version:1.0\r\n"; if($mailtype=="HTML"){ $header .= "Content-Type:text/html\r\n"; } $header .= "To: ".$to."\r\n"; if ($cc != "") { $header .= "Cc: ".$cc."\r\n"; } $header .= "From: $from<".$from.">\r\n"; $header .= "Subject: ".$subject."\r\n"; $header .= $additional_headers; $header .= "Date: ".date("r")."\r\n"; $header .= "X-Mailer:By Redhat (PHP/".phpversion().")\r\n"; list($msec, $sec) = explode(" ", microtime()); $header .= "Message-ID: <".date("YmdHis", $sec).".".($msec*1000000).".".$mail_from.">\r\n"; $TO = explode(",", $this->strip_comment($to)); if ($cc != "") { $TO = array_merge($TO, explode(",", $this->strip_comment($cc))); } if ($bcc != "") { $TO = array_merge($TO, explode(",", $this->strip_comment($bcc))); } $sent = TRUE; foreach ($TO as $rcpt_to) { $rcpt_to = $this->get_address($rcpt_to); if (!$this->smtp_sockopen($rcpt_to)) { $this->log_write("Error: Cannot send email to ".$rcpt_to."\n"); $sent = FALSE; continue; } if ($this->smtp_send($this->host_name, $mail_from, $rcpt_to, $header, $body)) { $this->log_write("E-mail has been sent to <".$rcpt_to.">\n"); } else { $this->log_write("Error: Cannot send email to <".$rcpt_to.">\n"); $sent = FALSE; } fclose($this->sock); $this->log_write("Disconnected from remote host\n"); } echo "<br>"; echo $header; return $sent; } /* Private Functions */ function smtp_send($helo, $from, $to, $header, $body = "") { if (!$this->smtp_putcmd("HELO", $helo)) { return $this->smtp_error("sending HELO command"); } #auth if($this->auth){ if (!$this->smtp_putcmd("AUTH LOGIN", base64_encode($this->user))) { return $this->smtp_error("sending HELO command"); } if (!$this->smtp_putcmd("", base64_encode($this->pass))) { return $this->smtp_error("sending HELO command"); } } # if (!$this->smtp_putcmd("MAIL", "FROM:<".$from.">")) { return $this->smtp_error("sending MAIL FROM command"); } if (!$this->smtp_putcmd("RCPT", "TO:<".$to.">")) { return $this->smtp_error("sending RCPT TO command"); } if (!$this->smtp_putcmd("DATA")) { return $this->smtp_error("sending DATA command"); } if (!$this->smtp_message($header, $body)) { return $this->smtp_error("sending message"); } if (!$this->smtp_eom()) { return $this->smtp_error("sending <CR><LF>.<CR><LF> [EOM]"); } if (!$this->smtp_putcmd("QUIT")) { return $this->smtp_error("sending QUIT command"); } return TRUE; } function smtp_sockopen($address) { if ($this->relay_host == "") { return $this->smtp_sockopen_mx($address); } else { return $this->smtp_sockopen_relay(); } } function smtp_sockopen_relay() { $this->log_write("Trying to ".$this->relay_host.":".$this->smtp_port."\n"); $this->sock = @fsockopen($this->relay_host, $this->smtp_port, $errno, $errstr, $this->time_out); if (!($this->sock && $this->smtp_ok())) { $this->log_write("Error: Cannot connenct to relay host ".$this->relay_host."\n"); $this->log_write("Error: ".$errstr." (".$errno.")\n"); return FALSE; } $this->log_write("Connected to relay host ".$this->relay_host."\n"); return TRUE;; } function smtp_sockopen_mx($address) { $domain = ereg_replace("^.+@([^@]+)$", "\\1", $address); if (!@getmxrr($domain, $MXHOSTS)) { $this->log_write("Error: Cannot resolve MX \"".$domain."\"\n"); return FALSE; } foreach ($MXHOSTS as $host) { $this->log_write("Trying to ".$host.":".$this->smtp_port."\n"); $this->sock = @fsockopen($host, $this->smtp_port, $errno, $errstr, $this->time_out); if (!($this->sock && $this->smtp_ok())) { $this->log_write("Warning: Cannot connect to mx host ".$host."\n"); $this->log_write("Error: ".$errstr." (".$errno.")\n"); continue; } $this->log_write("Connected to mx host ".$host."\n"); return TRUE; } $this->log_write("Error: Cannot connect to any mx hosts (".implode(", ", $MXHOSTS).")\n"); return FALSE; } function smtp_message($header, $body) { fputs($this->sock, $header."\r\n".$body); $this->smtp_debug("> ".str_replace("\r\n", "\n"."> ", $header."\n> ".$body."\n> ")); return TRUE; } function smtp_eom() { fputs($this->sock, "\r\n.\r\n"); $this->smtp_debug(". [EOM]\n"); return $this->smtp_ok(); } function smtp_ok() { $response = str_replace("\r\n", "", fgets($this->sock, 512)); $this->smtp_debug($response."\n"); if (!ereg("^[23]", $response)) { fputs($this->sock, "QUIT\r\n"); fgets($this->sock, 512); $this->log_write("Error: Remote host returned \"".$response."\"\n"); return FALSE; } return TRUE; } function smtp_putcmd($cmd, $arg = "") { if ($arg != "") { if($cmd=="") $cmd = $arg; else $cmd = $cmd." ".$arg; } fputs($this->sock, $cmd."\r\n"); $this->smtp_debug("> ".$cmd."\n"); return $this->smtp_ok(); } function smtp_error($string) { $this->log_write("Error: Error occurred while ".$string.".\n"); return FALSE; } function log_write($message) { $this->smtp_debug($message); if ($this->log_file == "") { return TRUE; } $message = date("M d H:i:s ").get_current_user()."[".getmypid()."]: ".$message; if (!@file_exists($this->log_file) || !($fp = @fopen($this->log_file, "a"))) { $this->smtp_debug("Warning: Cannot open log file \"".$this->log_file."\"\n"); return FALSE; } flock($fp, LOCK_EX); fputs($fp, $message); fclose($fp); return TRUE; } function strip_comment($address) { $comment = "\\([^()]*\\)"; while (ereg($comment, $address)) { $address = ereg_replace($comment, "", $address); } return $address; } function get_address($address) { $address = ereg_replace("([ \t\r\n])+", "", $address); $address = ereg_replace("^.*<(.+)>.*$", "\\1", $address); return $address; } function smtp_debug($message) { if ($this->debug) { echo $message."<br>"; } } function get_attach_type($image_tag) { // $filedata = array(); $img_file_con=fopen($image_tag,"r"); unset($image_data); while ($tem_buffer=AddSlashes(fread($img_file_con,filesize($image_tag)))) $image_data.=$tem_buffer; fclose($img_file_con); $filedata['context'] = $image_data; $filedata['filename']= basename($image_tag); $extension=substr($image_tag,strrpos($image_tag,"."),strlen($image_tag)-strrpos($image_tag,".")); switch($extension){ case ".gif": $filedata['type'] = "image/gif"; break; case ".gz": $filedata['type'] = "application/x-gzip"; break; case ".htm": $filedata['type'] = "text/html"; break; case ".html": $filedata['type'] = "text/html"; break; case ".jpg": $filedata['type'] = "image/jpeg"; break; case ".tar": $filedata['type'] = "application/x-tar"; break; case ".txt": $filedata['type'] = "text/plain"; break; case ".zip": $filedata['type'] = "application/zip"; break; default: $filedata['type'] = "application/octet-stream"; break; } return $filedata; } } ?>

2. 如何配置php.ini發送郵件

我的環境:XAMPP v3.2.1
准備工作
1.檢查有沒有sendmail程序,在xampp安裝目錄下的sendmail文件夾下。沒有則下載sendmail.zip(http://glob.com.au/sendmail/),然後解壓並放在在xampp目錄下。
2.去mail.google.com注冊一個google的郵箱,比如賬號:[email protected],密碼:passwd

配置步驟:
1.PHP.ini中如下設置:
; SMTP = localhost;
smtp_port = 25;
sendmail_from = sendmail_path = "C:/xampp/sendmail/sendmail.exe -t"
也就是注釋掉"SMTP"、"smtp_port"、"sendmail_from",設置sendmail_path變數的值為以上所示(根據自己電腦上sendmail.exe的目錄自行設置)。

2.sendmail.ini中如下設置
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=TLS
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=passwd

測試代碼:

[php] view plain print?
<?php
$now = date("Y-m-d h:i:s");
$headers = 'From: name<[email protected]>';
$body = "hi, this is a test mail.\nMy email: [email protected]";
$subject = "test mail";
$to = "[email protected]";
if (mail($to, $subject, $body, $headers))
{
echo 'success!';
}
else
{
echo 'fail';
}
?>
以上代碼執行後[email protected] 會收到發過來的郵件,但是郵件頭中的[email protected]會被替換成[email protected]

3. 怎麼利用php發送郵件求詳細教程

PHP雖然提供了mail()函數,但並不好用,而PHPMailer是一個不錯的郵件發送工具,接下來將詳細介紹,需要了解的朋友可以參考下:

本人使用wamp集成開發環境,Apache2.4.4, Mysql5.6.12 , php5.4.12.開始的時候使用mail()發送郵件,更改配置始終無法成功,了解到mail()函數使用需要sendmail程序。又下載了sendmail程序擴展包。按照網上的說法也改好了php.ini和sendmail.ini。使用foxmail 7.1創建了自己的qq郵箱賬戶,開啟了POP3/SMTP服務,更改發件伺服器為POP3,使用和收件伺服器相同的身份驗證,結果還是報錯:Warning: mail(): SMTP server response: 503 Error: need EHLO and AUTH first ! in F:\PHP\wamp\www\mail.php on line 8。以下是使用mail()函數發送郵件的php代碼:

[php] view plain
<span style="font-size:14px"><?php

$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
$send=mail($to,$subject,$message,$headers);
if($send)
echo "Mail Sent";
else
echo "Sorry,mail sent failed!"

?></span>
在CSDN論壇上發現phpmailer可以方便快捷的發送郵件,以下寫出詳細使用教程:
1.需要下載PHPMailer文件包,(點擊打開鏈接)

2.確認你的伺服器已經系統支持socket,通過phpinfo()查看是否支持socket;

3.把文件解壓到你的WEB伺服器目錄下,就可以使用PHPMailer發送郵件了。

以下為前台表單php代碼:

[php] view plain
<span style="font-size:14px"><html>
<body>
<h3>phpmailer Unit Test</h3>
請你輸入<font color="#FF6666">收信</font>的郵箱地址:
<form name="phpmailer" action="testemail.php" method="post">
<input type="hidden" name="submitted" value="1"/>
郵箱地址: <input type="text" size="50" name="to" />
<br/>
<input type="submit" value="發送"/>
</form>
</body>
</html> </span>
以下為後台程序:

[php] view plain
<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/

header("content-type:text/html;charset=utf-8");

ini_set("magic_quotes_runtime",0);

require('class.phpmailer.php');

try {
$mail = new PHPMailer(true); //New instance, with exceptions enabled

//$body = file_get_contents('contents.html');
//$body = preg_replace('/\\\\/','', $body); //Strip backslashes
$to = $_POST['to'];
$mail->CharSet="GB2312";//設置郵件字元編碼否則郵件會亂碼
$mail->Encoding="base64";
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = "smtp.qq.com"; // SMTP server
$mail->Username = "[email protected]"; // SMTP server username
$mail->Password = "000000000000"; // SMTP server password

//$mail->IsSendmail(); // tell the class to use Sendmail

$mail->AddReplyTo("[email protected]","han qing");

$mail->From = "[email protected]";
$mail->FromName = "han qing";

//$to = "[email protected]";

$mail->AddAddress($to);

$mail->Subject =$mail->Subject = "=?utf-8?B?" . base64_encode("First PHPMailer Message") . "?=";

$mail->Body = "<h1>phpmailer演示</h1> 這是用PHPMAILER發的第一份郵件,從QQ郵箱發到Google郵箱.";

$mail->AddAttachment("F:/myloe.jpg");

$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->WordWrap = 80; // set word wrap

//$mail->MsgHTML($body);

$mail->IsHTML(true); // send as HTML

$mail->Send();
echo 'Message has been sent.';
} catch (phpmailerException $e) {
echo $e->errorMessage();
}
?>

4. php郵件發送需配置些什麼

sendmail,或是stmp
如果是windows下面的php,設置smtp即可.
php.ini里.

5. php發送郵件配置問題

你可以先了解下郵件的幾個協議,smtp是發送郵件的一個協議,pop3是接收郵件的一個協議

要發郵件的話肯定需要一個支持smtp的郵件伺服器,

,自己配置還是較麻煩的,即使配置成功了,(如果你的伺服器不是在正規機房裡)你發出去的郵件會被視為垃圾郵件,因為你的域名需要反向解析。

你也可以用163的免費郵箱,他裡面里可以開啟smtp這個服務的(點上面的設置進去)。


至於代碼里怎麼寫,網上搜php郵件發送類

6. thinkphp發送郵件需要開啟什麼設置

郵件配置
'THINK_EMAIL' => array(
'SMTP_HOST' => 'smtp.163.com', //SMTP伺服器
'SMTP_PORT' => '465', //SMTP伺服器埠
'SMTP_USER' => '[email protected]', //SMTP伺服器用戶名
'SMTP_PASS' => 'ihtxt.com', //SMTP伺服器密碼
'FROM_EMAIL' => '[email protected]', //發件人EMAIL
'FROM_NAME' => '愛紅電子書', //發件人名稱
'REPLY_EMAIL' => '[email protected]', //回復EMAIL(留空則為發件人EMAIL)
'REPLY_NAME' => '愛紅電子書', //回復名稱(留空則為發件人名稱)
),
註:推薦使用163郵件,不要使用QQ郵箱,郵件配置一定要正確
可以將該函數放到ThinkPHPCommoncommon.php。也可以放到你生成的項目文件的Commoncommon.php。不過只能放到一個地方,否則就會報函數重定義錯誤。
/**
* 系統郵件發送函數
* @param string $to 接收郵件者郵箱
* @param string $name 接收郵件者名稱
* @param string $subject 郵件主題
* @param string $body 郵件內容
* @param string $attachment 附件列表
* @return boolean
*/
function think_send_mail($to, $name, $subject = '', $body = '', $attachment = null){
$config = C('THINK_EMAIL');
vendor('PHPMailer.class#phpmailer'); //從PHPMailer目錄導class.phpmailer.php類文件
$mail = new PHPMailer(); //PHPMailer對象
$mail->CharSet = 'UTF-8'; //設定郵件編碼,默認ISO-8859-1,如果發中文此項必須設置,否則亂碼
$mail->IsSMTP(); // 設定使用SMTP服務
$mail->SMTPDebug = 0; // 關閉SMTP調試功能
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // 啟用 SMTP 驗證功能
$mail->SMTPSecure = 'ssl'; // 使用安全協議
$mail->Host = $config['SMTP_HOST']; // SMTP 伺服器
$mail->Port = $config['SMTP_PORT']; // SMTP伺服器的埠號
$mail->Username = $config['SMTP_USER']; // SMTP伺服器用戶名
$mail->Password = $config['SMTP_PASS']; // SMTP伺服器密碼
$mail->SetFrom($config['FROM_EMAIL'], $config['FROM_NAME']);
$replyEmail = $config['REPLY_EMAIL']?$config['REPLY_EMAIL']:$config['FROM_EMAIL'];
$replyName = $config['REPLY_NAME']?$config['REPLY_NAME']:$config['FROM_NAME'];
$mail->AddReplyTo($replyEmail, $replyName);
$mail->Subject = $subject;
$mail->AltBody = "為了查看該郵件,請切換到支持 HTML 的郵件客戶端";

$mail->MsgHTML($body);
$mail->AddAddress($to, $name);
if(is_array($attachment)){ // 添加附件
foreach ($attachment as $file){
is_file($file) && $mail->AddAttachment($file);
}
}
return $mail->Send() ? true : $mail->ErrorInfo;
}
$r = think_send_mail('要發送的郵箱','發送人名稱,即你的名稱','文件標題','郵件內容');
windows下在php.ini中去掉下面的分號
extension=php_openssl.dll
並將allow_url_fopen = Off改為
allow_url_fopen = On

7. php如何發送郵件

你好,用這個郵件類,需要在調用時,填寫一個smtp伺服器和你的用戶名密碼。

<?php
set_time_limit(600);
/*
* 郵件發送類
*/
class smail {
//您的SMTP 伺服器供應商,可以是域名或IP地址
var $smtp = "";
//SMTP需要要身份驗證設值為 1 不需要身份驗證值為 0,現在大多數的SMTP服務商都要驗證,如不清楚請與你的smtp 服務商聯系。
var $check = 1;
//您的email帳號名稱
var $username = "";
//您的email密碼
var $password = "";
//此email 必需是發信伺服器上的email
var $s_from = "";
/*
* 功能:發信初始化設置
* $from 你的發信伺服器上的郵箱
* $password 你的郵箱密碼
* $smtp 您的SMTP 伺服器供應商,可以是域名或IP地址
* $check SMTP需要要身份驗證設值為 1 不需要身份驗證值為 0,現在大多數的SMTP服務商都要驗證
*/
function smail ( $from, $password, $smtp, $check = 1 ) {
if( preg_match("/^[^\d\-_][\w\-]*[^\-_]@[^\-][a-zA-Z\d\-]+[^\-](\.[^\-][a-zA-Z\d\-]*[^\-])*\.[a-zA-Z]{2,3}/", $from ) ) {
$this->username = substr( $from, 0, strpos( $from , "@" ) );
$this->password = $password;
$this->smtp = $smtp ? $smtp : $this->smtp;
$this->check = $check;
$this->s_from = $from;
}
}
/*
* 功能:發送郵件
* $to 目標郵箱
* $from 來源郵箱
* $subject 郵件標題
* $message 郵件內容
*/
function send ( $to, $from, $subject, $message ) {
//連接伺服器
$fp = fsockopen ( $this->smtp, 25, $errno, $errstr, 60);
if (!$fp ) return "聯接伺服器失敗".__LINE__;
set_socket_blocking($fp, true );
$lastmessage=fgets($fp,512);
if ( substr($lastmessage,0,3) != 220 ) return "錯誤信息1:$lastmessage".__LINE__;
//HELO
$yourname = "YOURNAME";
if($this->check == "1") $lastact="EHLO ".$yourname."\r\n";
else $lastact="HELO ".$yourname."\r\n";
fputs($fp, $lastact);
$lastmessage == fgets($fp,512);
if (substr($lastmessage,0,3) != 220 ) return "錯誤信息2:$lastmessage".__LINE__;
while (true) {
$lastmessage = fgets($fp,512);
if ( (substr($lastmessage,3,1) != "-") or (empty($lastmessage)) )
break;
}
//身份驗證
if ($this->check=="1") {
//驗證開始
$lastact="AUTH LOGIN"."\r\n";
fputs( $fp, $lastact);
$lastmessage = fgets ($fp,512);
if (substr($lastmessage,0,3) != 334) return "錯誤信息3:$lastmessage".__LINE__;
//用戶姓名
$lastact=base64_encode($this->username)."\r\n";
fputs( $fp, $lastact);
$lastmessage = fgets ($fp,512);
if (substr($lastmessage,0,3) != 334) return "錯誤信息4:$lastmessage".__LINE__;
//用戶密碼
$lastact=base64_encode($this->password)."\r\n";
fputs( $fp, $lastact);
$lastmessage = fgets ($fp,512);
if (substr($lastmessage,0,3) != "235") return "錯誤信息5:$lastmessage".__LINE__;
}
//FROM:
$lastact="MAIL FROM: <". $this->s_from . ">\r\n";
fputs( $fp, $lastact);
$lastmessage = fgets ($fp,512);
if (substr($lastmessage,0,3) != 250) return "錯誤信息6:$lastmessage".__LINE__;
//TO:
$lastact="RCPT TO: <". $to ."> \r\n";
fputs( $fp, $lastact);
$lastmessage = fgets ($fp,512);
if (substr($lastmessage,0,3) != 250) return "錯誤信息7:$lastmessage".__LINE__;
//DATA
$lastact="DATA\r\n";
fputs($fp, $lastact);
$lastmessage = fgets ($fp,512);
if (substr($lastmessage,0,3) != 354) return "錯誤信息8:$lastmessage".__LINE__;

//處理Subject頭
$head="Subject: $subject\r\n";
$message = $head."\r\n".$message;

//處理From頭
$head="From: $from\r\n";
$message = $head.$message;
//處理To頭
$head="To: $to\r\n";
$message = $head.$message;

//加上結束串
$message .= "\r\n.\r\n";
//發送信息
fputs($fp, $message);
$lastact="QUIT\r\n";
fputs($fp,$lastace);
fclose($fp);
return 0;
}
}
// 發送示例

// 只需要把這部分改成你的信息就行
$sm = new smail( "用戶名", "密碼", "發件smtp伺服器" );
$end = $sm->send( "收件人", "發件人(可以偽造哦)", "標題", "內容" );
if( $end ) echo $end;
else echo "發送成功!$x";
?>

8. 請問如何配置php.ini發送郵件

一般的linux系統中的主機Sendmail服務都是正常啟動的。你要在php.ini裡面配置的[mail
function],你就加上以下這個,然後試試看,其實,如果你要叫IXwebhosting的客服給你放上php.ini這個文件的話,這個語句默認就有的。
查看原帖>>

9. 請問一下,PHP配置SMTP怎麼弄

PHPMailer的獲取:

PHPMailer項目地址:PHPMailer 使用git命令克隆到本地,或直接在該項目頁面的右下方點擊「 Download ZIP 」即可獲取到完整的PHPMailer代碼包,再到本地解壓即可。

步驟一:使我們的QQ郵箱能夠發送郵件

這里怎麼說能夠發送郵件呢?其實我們的郵箱都是可以發送郵件的,但是要實現在我們的網站中發送郵件,那就要設置一下我們的QQ郵箱了,因為此時我們的網站現在是作為一個第三方客戶端存在的。

步驟一:使我們的QQ郵箱能夠發送郵件

這里怎麼說能夠發送郵件呢?其實我們的郵箱都是可以發送郵件的,但是要實現在我們的網站中發送郵件,那就要設置一下我們的QQ郵箱了,因為此時我們的網站現在是作為一個第三方客戶端存在的

閱讀全文

與php發送郵件配置相關的資料

熱點內容
願望清單app哪個好 瀏覽:457
安卓外放聲音怎麼解決 瀏覽:194
脈脈app干什麼用的 瀏覽:357
拽姐是哪個app 瀏覽:858
雲伺服器刪除了還有嗎 瀏覽:232
macbook可以用單片機嘛 瀏覽:307
南陽php招聘 瀏覽:814
去哪裡找按摩師很漂亮的app 瀏覽:818
86x99用簡便演算法計算 瀏覽:830
php截圖flash 瀏覽:274
卸載聯想app哪個好 瀏覽:721
php文字轉圖片 瀏覽:332
豆客後台怎麼加密碼 瀏覽:576
jpg轉換pdf破解版 瀏覽:980
php基礎書籍推薦 瀏覽:779
伺服器與外網不通如何驗證 瀏覽:353
電子版是不是就是文件夾 瀏覽:52
游戲屬性文件加密 瀏覽:464
如何讓安卓手機桌面圖標下移 瀏覽:530
ubuntuphp5環境搭建 瀏覽:101