【发布时间】:2016-06-06 16:43:18
【问题描述】:
我使用 swiftmailer 从 yii2 发送电子邮件。我从网站获取代码,但其中大多数从 gmail.com 发送电子邮件。我想从我的大学电子邮件发送电子邮件,但它不起作用。有什么问题。这是代码:
在 main-local.php 中
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => /*true*/false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.students.del.ac.id',
'username' => 'if414024@students.del.ac.id',
'password' => 'bmelar28',
'port' => '587',
'encryption' => 'tls',
],
],
【问题讨论】:
-
尝试删除主机中的
smtp,例如'host' => 'students.del.ac.id'
标签: yii2 swiftmailer