XAMPP, Mercury einrichten
bearbeitet von
> Mein Gott. man kann es sich aber auch schwer machen.
>
> ~~~php
> <?php
> $to = "mein.name@gmx.de";
> $subject = "Hello World";
> $message = "Test";
>
> if ('localhost' == $_SERVER['SERVER_NAME']) {
> test_mail($to, $subject, $message);
> } else {
> mail($to, $subject, $message);
> }
Scheint mir deutlich umständlicher und fehleranfälliger als das hier:
[https://forum.selfhtml.org/self/2016/nov/9/xampp-mercury-einrichten/1679612#m1679612](https://forum.selfhtml.org/self/2016/nov/9/xampp-mercury-einrichten/1679612#m1679612)
> function test_mail($to, $subject, $message) {
> $mail = implode("\r\n\r\n", array($to, $subject, $message));
> return file_put_contents ('mail.txt', $mail);
> }
>
> ~~~
>