⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basic.php

📁 FP2 CRM code+Mysql DB
💻 PHP
字号:
<?phprequire 'Net/SMTP.php';$host = 'mail.example.com';$from = 'user@example.com';$rcpt = array('recipient1@example.com', 'recipient2@example.com');$subj = "Subject: Test Message\n";$body = "Body Line 1\nBody Line 2";/* Create a new Net_SMTP object. */if (! ($smtp = new Net_SMTP($host))) {    die("Unable to instantiate Net_SMTP object\n");}/* Connect to the SMTP server. */if (PEAR::isError($e = $smtp->connect())) {    die($e->getMessage() . "\n");}/* Send the 'MAIL FROM:' SMTP command. */if (PEAR::isError($smtp->mailFrom($from))) {    die("Unable to set sender to <$from>\n");}/* Address the message to each of the recipients. */foreach ($rcpt as $to) {    if (PEAR::isError($res = $smtp->rcptTo($to))) {        die("Unable to add recipient <$to>: " . $res->getMessage() . "\n");    }}/* Set the body of the message. */if (PEAR::isError($smtp->data($subj . "\r\n" . $body))) {    die("Unable to send data\n");}/* Disconnect from the SMTP server. */$smtp->disconnect();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -