<?php
/**
 * Created by PhpStorm.
 * User: Enver
 * Date: 11.04.2017.
 * Time: 17:10
 */

$to = "durubedu@outlook.com";
$subject = "Ccwiz report";

$message = file_get_contents('http://' . $_SERVER['SERVER_NAME']. substr($_SERVER['REQUEST_URI'], 0, strlen($_SERVER['REQUEST_URI']) - 11) . '/index.php/?path=reports', FILE_USE_INCLUDE_PATH);

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <ccwiz@ccwiz.com>' . "\r\n";
$headers .= 'Cc: myboss@example.com' . "\r\n";

mail($to,$subject,$message,$headers);