I am trying to get this mail sent on registration using SwiftMailer, however it keeps throwing this error.
I am using this add-on for osCommerce: http://addons.oscommerce.com/info/901
I have followed the exact instructions as per what he said. Also added permissions still the same thing.
I am posting the code below:
CODE:
if (EMAIL_TRANSPORT == 'smtp') {
include_once(DIR_FS_CATALOG.DIR_WS_CLASSES . 'SwiftEmailer/swift_required.php');
$body = $this->html;
$body = preg_replace("[]",'',$body);
$host_name = explode('://',EMAIL_SMTP_HOST_SERVER);
if(count($host_name)>1){
$transport = Swift_SmtpTransport::newInstance($host_name[1], EMAIL_SMTP_PORT_SERVER, $host_name[0])
->setUsername(EMAIL_SMTP_USERNAME)
->setPassword(EMAIL_SMTP_PASSWORD);
} else {
$transport = Swift_SmtpTransport::newInstance(EMAIL_SMTP_HOST_SERVER, EMAIL_SMTP_PORT_SERVER)
->setUsername(EMAIL_SMTP_USERNAME)
->setPassword(EMAIL_SMTP_PASSWORD);
}
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance($subject)
->setFrom(array($from_addr => $from_name))
->setTo(array($to_addr => $to_name))
->setMaxLineLength(50);
if($body){
$message->setBody($body, 'text/html', CHARSET);
}
if($this->text){
$message->setBody($this->text, 'text/plain', CHARSET);
}
else{
$message->setBody($this->html_text, 'text/html', CHARSET);
}
$mailer->send($message);
}
If anyone could help me sort out this issue that would be great. Thank you