WordPress Email-Configuration (again) | WordPress.org

[ad_1]

Moderator
James Huff

(@macmanx)

Volunteer Moderator

This might be what you’re looking for:

It runs through PHP’s mail() function, so also make sure you compiled PHP with that.

Thread Starter
Jürgen

(@trimension)

Thanks for the tip… but that doesn’t really help… it just shows that there are a lot of problems here that have existed for many years and have never been solved.

I now have an error log showing that the “From” address is missing.

[20.08.2023 07:19:04.000000] [ERROR] WP_Error Object
(
    [errors] => Array
        (
            [wp_mail_failed] => Array
                (
                    [0] => Invalid address:  (From):
                )

        )

    [error_data] => Array
        (
            [wp_mail_failed] => Array
                (
                    [to] => Array
                        (
                            [0] => [email protected]
                        )

                    [subject] => Test Mail
                    [message] =>  This is the test mail from Trimension
                    [headers] => Array
                        (
                        )

                    [attachments] => Array
                        (
                        )

                    [phpmailer_exception_code] => 0
                )

        )

    [additional_data:protected] => Array
        (
        )

)

There is a comment on this that is 7 years old and describes that the sender address has to be predefined as a variable since WP version 4.6… but obviously it isn’t.

For testing I use the “WP Test Mail” plugin… this does not transfer a From address in the header and therefore probably doesn’t work.

Contact Form 7 passes the wp_mail function a correctly filled headers array, which also contains “From: “. Still the same error flies… The from is either removed or doesn’t arrive.

And BTW How I wrote, PHPs mail works fine directly called from any script 🙂

  • This reply was modified 45 minutes ago by Jürgen.

Thread Starter
Jürgen

(@trimension)

I found the Problem 🙂 There was a filter ‘wp_mail_from’ set by an installed plugin. This removed the default sender address 🙂

The decisive factor was the error log without which a problem cannot really be solved 🙂

  • This reply was modified 3 minutes ago by Jürgen.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer