Hi!
The mail function works perfectly on the WAMP server, but the Email class does not send the message.
What is happening?
Do I have to setup something more in the Email class?
The same code, in a server remote works perfectly.
Regards,
Jose A.
php.ini (WAMP server)
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = mail.dominiox.com
; http://php.net/smtp-port
smtp_port = 25
public function sendemail($data, $form){
if(!empty($this->Mailto)){
$email = $this->Mailto;
} else {
$email = EMAIL;
}
$headers = 'MIME-Version: 1.0'. "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: sender@sender.com' . "\r\n";
mail("info@dominiox.com","test subject","test body",$headers);
$from = $data['Email'];
$to = $email;
$subject = $this->subject;
$email = new Email($from, $to, $subject);
$email->setTemplate('Email');
$email->populateTemplate($data);
$email->send();
Director::redirect($this->Link('sent'));
}