php - Swift_TransportException with code 451 on server side -
i have error server. try send email in localhost , there right, mail sending. when upolad code on serwer have error time time. recognize mail spam.
swift_transportexception
expected response code 250 got code "451", message "451 ten e-mail zostal zaklasyfikowanu jako spam. w przypadku pytan prosimy o kontakt z naszymi konsultantami na stronie http://kontakt.o2.pl/ "
here function send email:
public function getuser() { $user = user::findone([ 'status' => user::status_deleted, 'email' => $this->email, ]); return url::to(['registration/confirm', 'key' => $user['auth_key']], true); } public function sendemail() { $status = yii::$app->mailer->compose('registrationmail',['url' => $this->getuser()]) ->setto($this->email) ->setcharset('utf8') ->setfrom([\yii::$app->params['supportemail'] => \yii::$app->params['supportemail']]) ->setsubject(self::subject) ->send(); return $status; }
and content of email:
<?php use yii\helpers\html; /* @var $this yii\web\view */ /* @var $user common\models\user */ ?> <div class="wrapper" style="width:960px; margin:0 auto;"> <div class="header" style="background:url('img/bg_header.png'); min-height:84px;"> <div class="header-content" style="width:800px; margin:0 auto; padding-top:20px;"> <a class="logo" href="" style="display:block; width:310px; height:50px; background:url('img/logo.png') no-repeat;"></a> </div> </div> <div class="content-wrapper" style="background:url('img/conteng-bg.png'); padding-bottom:10px;"> <div class="content" style="width:800px; margin:0 auto; padding-top:40px; color:#393838"> <h1 style="margin:0; font-size:24px;">xxxxxxxxx</h1> <h2 style=" font-size:18px;">xxxxxxxx,</h2> <p style="font-size:14px;">xxxxxxxxxxxxxxx:</p> <p href="#" style="font-size:14px; color:#c69f61; font-family:arial,helvetica,sans-serif;"><?= html::a(html::encode($url), $url) ?></p> <p style="font-size:12px; font-style:italic; margin:60px 0 50px 0;">xxxxxxxxxx</p> <span style="display:block; border-top:1px solid #a1a1a1; border-bottom: 1px solid #a1a1a1; font-size:12px; text-align:center; pxxxxxxxxxx <a href="mailto:xxxxx@xxxxxx.pl" style="color:#c69f61; ">xxxxx@xxxxx.pl</a></span> <p class="copyright" style="color:#807f7f; text-align:center; font-size:10px; margin-top:20px;">xxxxxxx © xxxxx 2016</p> </div> </div> </div>
i write xxx have data. know how resolve erron on server?
\yii::$app->params['supportemail']
should contain username http://poczta.o2.pl/
Comments
Post a Comment