// v AutoMail Section KIY-03
$mailsent = '';
$fullurl = '';
if(strlen($_POST['myLink']) > 500) {
	$fullurl = substr($_POST['myLink'], 0, 500) . "...";
} else {
	$fullurl = $_POST['myLink'];
}
$to = 'contact@kiyantk.nl'; // Replace with your own email address
$subject = 'test.kiy.li - Link created!';
$message = 'test.kiy.li URL: https://test.kiy.li/go/' . $_POST['myName'] . "\r\n\n" .
           'Full URL: ' . $fullurl . "\r\n\n" .
           'Sent using Kiy.li AutoMail Service' . "\r\n" .
	   'Email ID: KIY-03-' . strtoupper($_POST['myName']);

$headers = 'From:  Kiy.li AutoMail <automail@kiy.li>' . "\r\n" .
           'X-Mailer: PHP/' . phpversion();

if (mail($to, $subject, $message, $headers)) {
	$mailsent = 'true';
} else {
	$mailsent = 'false';
}
// ^ AutoMail Section KIY-03