Support » Plugin: WP Mail SMTP by WPForms » Wp-config.php New Settings Force from and Force Name

  • Resolved kennibc

    (@kennibc)


    Can I set the new settings: Force Name and Force From in wp-config.php like the other settings. I believe this is causing an issue since our SMTP server will only accept emails from a no-reply address for the website that uses your plugin.

    Without this checked other plugins run into an error and we have over 1000 blogs that each person would have to login and check these boxes.

    I am hopeful I can set this at admin level and it works for all websites. Any assistance would be great.

    Thanks,
    Chris

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m looking for the exact same thing. All other important settings can be controlled by wp-config defines, but I’m not finding any documentation inside wp_mail_smtp.php regarding the new “Force From Email” and “Force From Name” options.

    On multisite, this is pretty important.

    Plugin Author Slava Abakumov

    (@slaffik)

    WPMS_MAIL_FROM_NAME_FORCE and WPMS_MAIL_FROM_FORCEtrue or false are accepted.

    More details here: \WPMailSMTP\Options::get_const_value()

    Thank you so much for your quick response today!

    I’ve added:
    define('WPMS_MAIL_FROM_FORCE', 'true');

    to wp-config.php

    In the UI on options-general.php?page=wp-mail-smtp the checkbox becomes greyed out, but it does not show as “checked”

    However, the sending address is correctly forced to my defined sending email address. Solved for me!

    I think there is still something amiss. I spent a bit of time debugging one of our multisite instances that had the setting on, but the box was greyed out without the checkbox. Force from wasn’t applied. I disabled the settign, toggled it manually and it worked. Enabling it again shows the checkbox greyed out but now the check is there.

    We were able to really get a good feeling for this during our testing tonight. We Network Activated the plugin on a multisite. For sites where the plugin wasn’t already active, or sites where the MAIL_FROM_FORCE wasn’t already checked, we saw the checkbox greyed out without a check. Sites that already had the box checked were greyed out without the check.

    As a workaround we tried turning off network activation and toggling the plugin from the site, but the behavior remained the same as above.

    I commented out the define(‘WPMS_MAIL_FROM_FORCE’, ‘true’); line, toggled the setting in WordPress, then readded the line. This was an effective way to get the checkbox marked.

    We’ve disabled the flag for now to allow us to toggle it without changing our config file. Hoping there’s a CLI option for this. Hopefully this information is usefel.

    Regards

    sorry for spamming a closed thread, one more interesting behavior. On a new site with this setting: define(‘WPMS_MAIL_FROM_FORCE’, ‘true’); the box appears greyed out an unchecked, however, just clicking save on the settings page will insert a check into the greyed out box.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Wp-config.php New Settings Force from and Force Name’ is closed to new replies.