I didn't set up anything nor changed any setting on Openshift's side, my code is returning a success status but the mail is not being sent. See my code below:
$headers = "MIME-Version: 1.0" . "
";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "
";
$headers .= "From: Lubcon Cloud Team <no-reply@lubconcloud.com>" . "
";
$headers .= "Reply-To: no-reply@lubconcloud.com"."
";
$body = "Click the link below to reset your password: <br/><br/> <a href='$resetlink'>$resetlink</a>";
if(mail($to, $subject, $body, $headers)) {
$app->status(200);
$app->response()->write(
json_encode(array("data"=> 'Email Sent'))
);
} else {
$app->status(403);
$app->response()->write(
json_encode(array("code"=>"105", "data"=> "Failed to send email"))
);
}
This code works on my localhost but not when uploaded to Openshift, I am using Ubuntu. Any idea how to make this work without any third party plugins? Do I need to set-up anything?
Thanks