$request_email = $_POST['request-email'];
$request_name = $_POST['request-name'];
$request_text = $_POST['request-text'];
$transport = (new Swift_SmtpTransport('data.abc.xy', 587, 'tls'))
->setUsername('contact@abc.xy')
->setPassword('*******')
->setStreamOptions(array('ssl' => array('allow_self_signed' => true, 'verify_peer' => false)));
$mailer = (new Swift_Mailer($transport));
$message = (new Swift_Message('Name: '. $request_name))
->setFrom(['' . $request_email => '' . $request_name])
->setTo(['contact@abc.xy'])
->setBody('E-Mail: ' . $request_email . $request_text)
->setContentType("text/html");
$result = $mailer->send($message);
我们尝试重新安装Mail-in-a-box和所有组件,并检查所有拼写错误。收件人确实存在于我们的邮件服务器上,可以通过客户端手动接收和发送邮件。
MAIL_USERNAME
和MAIL_FROM_ADDRESS
是否都指向同一个域名。 - Tariqul Islam