【发布时间】:2013-05-14 15:04:06
【问题描述】:
我用 SMTPClient 类邮件 utf-8 发帖,但是我什么都没做! 请帮我收下,谢谢
class SMTPClient
{
function SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body)
{
$this->SmtpServer = $SmtpServer;
$this->SmtpUser = base64_encode ($SmtpUser);
$this->SmtpPass = base64_encode ($SmtpPass);
$this->from = $from;
$this->to = $to;
$this->subject = $subject;
$this->body = $body;
if ($SmtpPort == "")
{
$this->PortSMTP = 25;
}else{
$this->PortSMTP = $SmtpPort;
}
}
///////////////////////////////////////////////////////////////////////
$to = $_POST['to'];
$from =$_POST['from'];
$subject = $_POST['sub'];
$body = $_POST['message'];
$SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body);
$SMTPChat = $SMTPMail->SendMail();
我在这里找到了这段代码:http://url.lid.ir/KPyhfU
【问题讨论】:
-
您是否遇到任何错误?
-
这也是旧的php类格式...
function SMTPClient应该改为public function __construct -
所有邮件都已发送,但我想发送需要 utf-8 可读的 utf-8 格式文本
-
本课将指导你如何改变说话的方式?
-
对不起,你没有问一个明确的问题,只是粘贴你在网上找到的代码说它不起作用。请提供您收到的实际错误的详细信息以及它如何无法按预期工作
标签: php utf-8 smtp smtpclient