Hello. I just uploaded my projet to x10hosting, but when I try to send an e-mail, It doesn't arrive to my inbox. I'm using the php function mail().Here's my code, but I don't think it's a mistake from me, I think the mails server are not working correctly. Can you help me? Thanks in advance.
PHP:
<?php
include 'connect.php';
function send_mail($from,$to,$subject,$body)
{
$headers = "Content-type: text/html; charset=ISO-8859-1\r\n";
$headers .= "From: $from\n";
$headers .= "Reply-to: $from\n";
$headers .= "Return-Path: $from\n";
$headers .= "Message-ID: <" . md5(uniqid(time())) . "@" . $_SERVER['SERVER_NAME'] . ">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Date: " . date('r', time()) . "\n";
mail($to,$subject,$body,$headers);
}
function emailconfirmacion($usr){
$resultado = mysql_query("SELECT * FROM usuarios WHERE usr = '".$usr."'");
$fila = mysql_fetch_array($resultado, MYSQL_ASSOC);
$codigo = md5(microtime());
$email = file_get_contents('http://miniwars.tk/email.php?usr='.$usr.'&code='.$codigo);
send_mail('admin@miniwars.tk',$fila['email'],'MiniWars - Confirma tu e-mail',$email);
mysql_query("UPDATE usuarios SET codigo = '".$codigo."' WHERE usr = '".$usr."'");
}
emailconfirmacion('sfcpfc');
?>
Last edited: