These are my headers:
$defaultHeaders = 'MIME-Version: 1.0' . "\r\n";
$defaultHeaders .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$defaultHeaders .= 'From: Kyote Productions <no-reply@' . $_SERVER['SERVER_NAME'] . '>' . "\r\n";
$this->headers = (!empty($headers)) ? $headers : $defaultHeaders;
These are my subject, message and recipient:
$this->subject = $subject;
$this->message = $message;
$this->to = $recipient;
I am sending the mail like this:
return mail($this->to, $this->subject, $this->message, $this->headers);
When I write a method to var_dump()
all these results they look like this:
array(4) {
[0]=>
string(39) "x@outlook.com,z@gmail.com,"
[1]=>
string(18) "PHP Mailer by Kyle"
[2]=>
string(187) "<html><head><title>PHP Mailer by Kyle</title></head><body><img style="width: 100%; height: 200px;" src="http://wallpapercave.com/wp/Qom1Iwe.jpg"><br /><br />Test email baby!</body></html>"
[3]=>
string(112) "MIME-Version: 1.0
Content-type: text/html; charset=UTF-8
From: Kyote Productions <no-reply@kyoteprod.x10.mx>
"
}
1
Error reporting is on, but I receive no errors and it returns 1 when I run this:
echo (int)$obj->sendMail();