Escribí el siguiente código para enviar un correo electrónico a mi dirección de correo electrónico desde mi sitio.
Pero no funciona.
Usé el siguiente formulario HTML en la página de contacto de mi sitio.
<?php if(isset($_POST['submit'])) { $to ="amishaharali@gmail.com"; $subject = "E-mail from Ushar Alo Contact Person"; $txt = $_POST['comment']." -by :".$_POST['mail']; $headers = "From: msalipbl@gmail.com"; if(mail($to,$subject,$txt,$headers)){ echo "Successfully sent!"; }else{ echo " Sorry! a problem to send the E-mail!"; } }else{ ?> <hr/> <h3>Send e-mail to the Administrator :</h3> <form action="http://usharalo.eu.pn/contact.php" method="post"> Name:<br> <input type="text" name="name"><br> E-mail:<br> <input type="text" name="mail"><br> Comment:<br> <input type="text" name="comment" size="50"><br><br> <input type="submit" name ="submit" value="Send"> <input type="reset" name="reset" value="Reset"> </form> <?php } ?>