Im new here. Im trying to send an E-Mail to someone using PHP. While looking around, i found some information that helped me, but didnt solve the problem. I dont know where the mistake could be.
When i try to send the form, i get an empty site, which means that i didnt get any errors. But i dont receive a mail.
What i have already tried:
- Changes in php.ini & sendmail.ini
- Trying to get an error with error_get_last()
The code i use:
mail.php
<?php
$m = $_POST['mail'];
$b = $_POST['subject'];
$z = $_POST['time'];
$d = $_POST['date'];
$hf = $_POST['mw'];
$f = $_POST['company'];
$t = $_POST['phone'];
$ta = $_POST['ta'];
$n = "test";
if(!empty($_POST['ha'])){$ha = "Something";} else { $ha = "Something else";}
if(!empty($_POST['hz'])){$hz = "Something";} else { $hz = "Something else";}
if(!empty($_POST['rwa'])){$rwa = "Something";} else { $rwa = "Something else";}
if(!empty($_POST['ba'])){$ba = "Something";} else { $ba = "Something else";}
mail($m, $b, $n); ?>
php.ini
SMTP = smtp.gmail.com
smtp_port = 587
sendmail_from = gluray.simons@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
;sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"
sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
mail.add_x_header=Off
sendmail.ini
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=gluray.simons@gmail.com
auth_password=mypassword
force_sender=gluray.simons@gmail.com
I use Xampp Control Panel v3.2.2, PHP 5.6.15
Thanks in advance.