Hi,
I’m trying to use the phpmailer, but i get the error:
Cannot redeclare class SMTP in <b>/Developer/php/Mariana/protected/extensions/mailer/phpmailer/class.smtp.php</b> on line <b>49</b>
The code that i’m using is
Yii::app()->mailer->Host = $smtp->host;
Yii::app()->mailer->IsSMTP();
Yii::app()->mailer->SMTPAuth=true;
Yii::app()->mailer->From = $_POST["email"];
Yii::app()->mailer->Port = $smtp->port;
Yii::app()->mailer->Username = $smtp->email;
Yii::app()->mailer->Password = $smtp->password;
Yii::app()->mailer->FromName = $_POST["name"];
Yii::app()->mailer->AddReplyTo($_POST["email"]);
Yii::app()->mailer->AddAddress($smtp->email);
Yii::app()->mailer->Subject = utf8_decode($_POST["subject"]);
Yii::app()->mailer->Body = utf8_decode($_POST["text"]);
echo Yii::app()->mailer->Send();
Components
'mailer' => array(
'class' => 'application.extensions.mailer.EMailer',
),
It seems another place is loading it, this problem only happen when i call the send.