1

i have some problem with my mailer or SMTP i don't know, 'cuz im noob. Its works nice on web, and i fill my details(Name,email,message) and hit submit button and its says message has been sent, but when i checked my gmail acc, there is no message. Below is my code:

    <div id="contact">
    <h1>CONTACT ME!</h1>
    <form method="POST" action="">
        <input type="text" placeholder="First & Last name.." name="name" required>
        <input type="email" placeholder="Enter your email..." name="email" required>
        <textarea placeholder="Your message..." name="message" required></textarea>
        <input type="submit" value="SEND" name="button">
    </form>
<?php 
if(isset($_POST['button'])){
    $to = "roodrd@gmail.com";  
$subject = "Contact form test";  
$email = isset($_POST['email']) ;  
$message = isset($_POST['message']);  
$headers = "From: $email";  
$sent = mail($to, $subject, $message, $headers) ;  
if($sent)  {
    echo "Your mail was sent successfully"; 
} else  {
    echo "We encountered an error sending your mail"; 
}

    }

?>

php.ini

    [mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = roodrd@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

sendmail.php(this is all what i have in file)

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=roodrd@gmail.com
auth_password=MYPASSWORD
force_sender=roodrd@gmail.com

Sorry for bad English and just to know i'm using XAMPP.

rood
  • 15
  • 4

0 Answers0