I've been searching for hours to find the answer to my email sending problem in PHP...
No posts on stackoverflow or google helped me so far, thats why im trying it now here.
I am using XAMPP and i want to send an email to my web.de mail with my custom domain mail
My PHP Class (E-Mails are correct in my private file):
sending.php
<?php
$to = "MY OWN EMAIL";
$subject = "Thank you for downloading";
$headers = array(
"MIME-Version" => "1.0",
"Content-Type" => "text/html;charset=UTF-8",
"From" => "EMAIL CREATED ON STRATO",
"Reply-To" => "EMAIL CREATED ON STRATO"
);
$message = "Test :)";
$send = mail($to, $subject, $message, $headers);
echo ($send ? "Mail was sent" : "error :(");
?>
http://localhost/mailtest/sending.php Output: error :(
sendmail.ini
[sendmail]
smtp_server=smtp.strato.de
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=EMAIL CREATED ON STRATO
auth_password=EMAIL PASSWORD CREATED ON STRATO
force_sender=EMAIL CREATED ON STRATO
php.ini
...
[mail function]
SMTP=smtp.strato.de
smtp_port=587
sendmail_from = EMAIL CREATED ON STRATO
sendmail_path = "\"Z:\XAMPP\sendmail\sendmail.exe\" -t"
...
line 18: echo error_get_last()['message'];
Output: Trying to access array offset on value of type null in Z:\XAMPP\htdocs\mailtest\sending.php on line 18
Thanks for helping!