Answer the question
In order to leave comments, you need to log in
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,
),
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
Answer the question
In order to leave comments, you need to log in
it worked with this config
'Smtpmail'=>array(
'class'=>'application.extensions.smtpmail.PHPMailer',
'Host'=>'mail.mycompany.ru',
'Username'=>'',
'Password'=>'',
'Mailer'=>'smtp',
'Port'=>25,
'SMTPDebug' => 1,
),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question