1

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" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: Lubcon Cloud Team <no-reply@lubconcloud.com>" . "\r\n";
$headers .= "Reply-To: no-reply@lubconcloud.com"."\r\n";

$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

clintgh
  • 2,039
  • 3
  • 28
  • 44

0 Answers0