Php swiftmailer的新功能
我是swiftmailer的新手,我有这种错误 致命错误:无法在第17行的/home/hosting/public\u html/lib/classes/Swift/Mime/Headers/DateHeader.php中重新声明类Swift\u Mime\u Headers\u DateHeader 我不知道该怎么办,请帮忙 我的代码是:Php swiftmailer的新功能,php,html,email,swiftmailer,Php,Html,Email,Swiftmailer,我是swiftmailer的新手,我有这种错误 致命错误:无法在第17行的/home/hosting/public\u html/lib/classes/Swift/Mime/Headers/DateHeader.php中重新声明类Swift\u Mime\u Headers\u DateHeader 我不知道该怎么办,请帮忙 我的代码是: require_once 'lib/swift_required.php'; // Create the Transport $tran
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('your username')
->setPassword('your password')
;
/*
You could alternatively use a different transport such as Sendmail or Mail:
// Sendmail
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
// Mail
$transport = Swift_MailTransport::newInstance();
*/
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create a message
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('john@doe.com' => 'John Doe'))
->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name'))
->setBody('Here is the message itself')
;
// Send the message
$result = $mailer->send($message);