電子メールを送信するための安定した実績のある SMTP クラス (使用方法の説明を提供してください)、ありがとうございました。

WBOY
リリース: 2016-06-13 13:51:54
オリジナル
1292 人が閲覧しました

電子メールを送信するための安定した耐久性のある SMTP クラスを提供してください (使用方法を提供してください)。ありがとうございます。
いくつかは使用できず、送信できず、テキストがありません。
これらを全て記載した文章もありますが、何通か送信すると「アカウントがロックされました」と表示され、discuzphpwindなどのメールの種類が複雑すぎて分離できません

ありがとうございます!! !
メール機能と IIS を使用して SMTP を取得すると、アドレスが無効です。「aaa 」または「aaa@163.com」と表示されます。どちらも間違っています

比較的大きい場合は、lein_urg@163.com までメールを送信してください。ありがとうございます。
メールの送信者には、少なくとも 20 ポイントが付与されます。最低 60 分かかります。

------ 解決策------------------
class smtp
{
/* パブリック変数 */
var $smtp_port;
var $time_out; 🎜> var $relay_host;
var $debug; > var $user;

/* プライベート変数 */

/* コントラクター */
function smtp($relay_host = " ", $smtp_port = 25,$auth = false,$user,$pass)
{
$this-> debug = FALSE; > $this-> smtp_port = $smtp_port;
$this->lay_host = $relay_host;
$this-> time_out = 30; // fsockopen() で使用されます
$this-> auth = $auth; //認証
$this-> user = $user;
$this-> host_name = "localhost ";
$this-> log_file = " ";
$this-> sock =
}

/* メイン関数 */
function sendmail($to, $from , $subject = " ", $body = " ", $mailtype, $cc = " ", $bcc = " ", $Additional_headers = " ")
{
$mail_from = $this-> get_address( $this->strip_comment($from));
$body = ereg_replace( "(^|(rn))(.) ", "1.3 ", $body);
$header .= "MIME-バージョン:1.0rn ";
if($mailtype == "HTML ")
{
$header .= "Content-Type:text/htmlrn ";
}
$header . = "To: ".$to. "rn ";
if ($cc != " ")
{
$header .= "Cc: ".$cc "; > }
$header .= "From: $ from
rn ";
$header .= "Subject: ".$subject.
$header .= $Additional_headers; 🎜> $header .= "Date: ".date( "r "). "rn ";
$header .= "X-Mailer:By Redhat (PHP/ ".phpversion(). ")rn ";
list($msec, $sec) =explode ( " ", microtime());
$header .= "メッセージ ID:
rn "; ", $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 として $rcpt_to)
{
$rcpt_to = $this-> get_address($ rcpt_to);
if (!$this-> smtp_sockopen($rcpt_to))
{
$this-> log_write( "エラー: ".$rcpt_to. "n "); 🎜> $sent = FALSE;
続行;
}
if ($this-> smtp_send($this-> host_name, $mail_from, $rcpt_to, $header, $body))
{
$this-> log_write( "電子メールは
n ") に送信されました。
}
else
{
$this-> log_write( "エラー: 送信できません
n ");
$ send = FALSE;
}
fclose($this-> sock);
$this-> log_write( "リモート ホスト n から切断されました ");
}
$sent を返します。

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!