• Moderator Ipstenu (Mika Epstein)

    (@ipstenu)


    ?????? Advisor and Activist

    Every time I used WP-CLI, I got this error: Notice: Undefined index: SERVER_NAME

    That’s because SERVER_NAME is not available via command line. There is a fix though.

    Edit the file: postman-smtp/Postman/Postman-Mail/PostmanDefaultModuleTransport.php

    Change this (line 37):

    $sitename = strtolower ( $_SERVER ['SERVER_NAME'] );

    To this:

    
    $siteurl = parse_url( esc_url( site_url() ) );
    $sitename = $siteurl['host'];
    

    Works fine now ??

Viewing 1 replies (of 1 total)
  • great, this seems to fix it for me. Thanks Ipstenu!
    Will this be updated in the plugin? or will we have to always do this after each plugin update?

Viewing 1 replies (of 1 total)
  • The topic ‘Causes CLI errors because SERVER_NAME is not available’ is closed to new replies.