Click here to Skip to main content
15,888,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello.
I have a contact form in my website (the website is online) and i also have a php file that handles the POST of the form.
Everything works great i even get a success message but the problem is that i dont receive an email in my server.
I have tried google, outlook and the email that my server hosting provides me with.
(KEEP IN MIND THIS IS A FREE HOSTING).
Bellow is the php code.

What I have tried:

PHP
<?php 
if (isset($_POST['submit'])) 
{ 
    $name = $_POST['name']; 
    $subject = $_POST['subject']; 
    $mailFrom = $_POST['mail']; 
    $message = $_POST['message']; 
    $mailTo = "info@resume-portfolio.epizy.com"; 
    $headers = "From: ".$mailFrom; 
    $txt = "You have received an e-mail from ".$name.".\n\n".$message; 
    mail($mailTo, $subject, $txt, $headers); 
    header("Location: index.php?mailsend"); 
    }

    die;
    ?>
Posted
Updated 16-Jul-19 1:11am
v2
Comments
Richard MacCutchan 6-Jul-19 4:41am    
Check your configuration settings for the mail server. you could also try sending a message directly through the server to check that it is working.

You should also check the return status from the mail function.

check your mail configuration.
if your mail in you set the 2-3 step verification then not allow to send the mail.
 
Share this answer
 
check your mail configuration.t
if your mail in you set the 2-3 step verification then not allow to send the mail.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900