Page 1 of 1

Sending email from one local email account to another on Thu

PostPosted: 25. August 2022 14:24
by fnpb93
Currently trying to do the following but was unable to do so:

Set up 2 accounts on Mercury using XAMPP.
Install Thunderbird and add both accounts as POP3 accounts.
Sending using the Thunderbird client from one user to another works fine.
However, using testsend.php does not work for me and produces an error:
Warning: mail(): SMTP server response: 553 We do not relay non-local mail, sorry. in C:\xampp\htdocs\email\testsend.php on line 17

testsend.php

Code: Select all
<!DOCTYPE html>
<html>

<body>
    <h1>Hello mail</h1>
    <p>My first m</p>
    <?php

    $to      = 'user@local';
    $subject = 'Email';
    $message = 'Test';

    $headers = 'From: userb@local' . "\r\n" .
        'Reply-To: userb@local' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers, '-user@localhost');
    echo 'sent successfully!';


    ?>

</body>

</html>


I've received the warning, and after some googling, I did this:
Image

Unticking the box.

Afterward, I reran the file; there were no warnings or errors this time. However, no emails appeared in my Thunderbird client for both users.

Any possible solutions to this? Thank you!

Re: Sending email from one local email account to another on

PostPosted: 22. September 2022 00:45
by FKlusmann
Hi, @fnpb93
If you ever found out how to get XAMPP - PHP to truly send an email, please let us know how. I arrived here searching for help as well.
Thanks. -- Fred