D
D
des1roer2015-06-24 12:05:02
Yii
des1roer, 2015-06-24 12:05:02

PHP mailer error?

in general, I use this extension www.yiiframework.com/extension/smtp-mail/#hh0
but I think they have a common
config

'components' => array(
        'Smtpmail'=>array(
            'class'=>'application.extensions.smtpmail.PHPMailer',
            'Host'=>"myfactory.mail.ru",
            'Username'=>'',
            'Password'=>'',
            'Mailer'=>'smtp',
            'Port'=>25,
            'SMTPAuth'=>false, 
            'SMTPDebug' => 1,
        ),

controller
public static function mailsend($to,$from,$subject,$message){
        $mail=Yii::app()->Smtpmail;
        $mail->SetFrom($from, 'From NAme');
        $mail->Subject    = $subject;
        $mail->MsgHTML($message);
        $mail->AddAddress($to, "");
        
        if(!$mail->Send()) {
            echo "Mailer Error: " . $mail->ErrorInfo;
        }else {
            echo "Message sent!";
        }
        $mail->ClearAddresses();
    }

    public function actionContact()
    {
\\\\\
SiteController::mailsend(Yii::app()->params['adminEmail'],$model->name,'test',$model->body);

Invalid address: adminSMTP -> ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: ����������� ��� �����, �� ������ ��� ��������� ���� �� ��������. (0)
The following From address failed: [email protected] : Called Mail() without being connected Mailer Error: The following From address failed: [email protected] : Called Mail() without being connected

is it necessary to specify login\pass?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
des1roer, 2015-06-24
@des1roer

it worked with this config

'Smtpmail'=>array(
            'class'=>'application.extensions.smtpmail.PHPMailer',
            'Host'=>'mail.mycompany.ru',
            'Username'=>'',
            'Password'=>'',
            'Mailer'=>'smtp',
            'Port'=>25,           
            'SMTPDebug' => 1,
        ),

in fact, I messed up the host name

O
Optimus, 2015-06-24
Pyan @marrk2

login pass is mandatory, there Yandex switched to ssl even more carefully

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question