我正在为一所大学开发一个网络应用程序,希望在提交表单后使用swift-mailer发送确认电子邮件。我理解以下代码的其余部分,但我不确定$ transport我应该放在'smtp.example.org'的位置?
$transport = (new Swift_SmtpTransport('smtp.example.org', 25))
->setUsername('your username')
->setPassword('your password')
;
// Create the Mailer using your created Transport
$mailer = new Swift_Mailer($transport);
// Create a message
$message = (new Swift_Message('Wonderful Subject'))
->setFrom(['john@doe.com' => 'John Doe'])
->setTo(['receiver@domain.org', 'other@domain.org' => 'A name'])
->setBody('Here is the message itself')
;
// Send the message
$result = $mailer->send($message);
发布于 2018-09-21 10:27:29
我建议您阅读以下内容:https: //www.makeuseof.com/tag/technology-explained-how-does-an-email-server-work/
TLDR:
您应该输入电子邮件服务器的地址。
https://stackoverflow.com/questions/-100002707
复制相似问题