We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18913
    • 654 Posts
    Can anyone tell me if there were problems in older versions of WebLoginPE that resulted in no emails getting sent for forgotten passwords? Here’s the situation I’ve got.

    I have two sites on the same host (bluehost). Each is using WebLoginPE to handle logins. In the case of site #1, if there is no php.ini file in the root directory and the cpanel php settings are set accordingly, the emails are sent with the "from" field set to something of the form of

    [email protected]

    If I change the php settings in cpanel accordingly and put a php.ini file in the root that looks like this :
    [mail function]
    
    sendmail_path = /usr/sbin/sendmail -t -i -nYourCompanyName
    
    zend_extension=/usr/lib64/php/modules/ioncube_loader_lin.so
    zend_extension=/usr/lib64/php/modules/ixed.lin
    zend_extension=/usr/lib64/php/modules/ZendOptimizer.so
    

    I get a "from" field that looks something like "Matt’s Company".

    So far so good. The problem is with site #2

    If I go through all the same steps, I can get an email with the first (not preferred) "from" type address by not using a php.ini file. But if I put a php.ini file in (as
    in the second instance above), I get *no* email.

    Complicating things, a contact form on site 2 using eform does generate an email. And
    putting site 2’s version of WLPE on site 1 also generates an email.

    Can anyone suggest what might be going on here? I’m kinda stumped and am thinking the problem/solution might be somewhere I haven’t thought to look. (Path differences aside,
    the .htaccess files are the same).

    Alternatively, if anyone can tell me another way to force the "From" field to be a certain value - rather than dealing with it in php.ini - I’d be appreciative. I’ve got a feeling I’m overlooking something very obvious.

    TIA,
    Matt
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It should just accept a &from=`...` parameter, either a specific email address or the placeholder using the form’s email field. You can also use &fromname and &replyto.
      [!eForm? &formid=`ContactForm` &tpl=`ContactForm` &report=`ContactReport` &subject=`sottwell.com Contact` &thankyou=`ThankYou` &from=`[+email+]` &fromname=`[+name+]` &replyto=`email` &eformOnBeforeMailSent=`getServer` &eformOnValidate=`checkField`!]
      


      (Thank you for this question! I had updated everything, including eForm, and forgot to change the isMail to isSMTP! No wonder my contact page has been so quiet lately!)
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 18913
        • 654 Posts
        Hi,
        Thanks for your reply. I may not have been as clear as I could have been smiley I’m not having a problem with the eForm page that I have. It’s the WebLoginPE routine that seems to be getting tripped up somewhere. Without a php.ini file it generates an email but with what I’d call a less-than-friendly "From" field. If I add a parameter to the sendmail path in a small php.ini file, I don’t get an email at all. Further, I’m not seeing any relevant error messages in any log files, or a debug file to set to trace through WebLoginPE.

        If I overlooked something in your reply, please set me straight and accept my apology!

        There’s obviously something I’m not appreciating about how this particular site is set up.
        Matt
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Sorry; I’ve been working with a complex eForm situation and got my wires crossed.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 18913
            • 654 Posts
            ... And the root cause of this joy ride through code ... (you know) was :

            And invalid email address in the email field under Tools->Configuration->User. The email address in that box (at least for me, on Bluehost) has to be valid in order for an email to *really* go out. I’ve got a funny feeling that MODx isn’t catching that, but I’ll leave that for brighter minds than mine to decide.

            When this address was specified as something like this
            Test Co. <[email protected]>
            and when the PHP settings in Bluehost’s cPanel were set to use the php.ini file found in the public_html folder
            and when said php.ini file contained the extra parameter to "sendmail" (as noted above), then
            - emails sent via a contact form showed the "nice" "From" field to both recipient and sender
            and
            - emails sent from WebLoginPE showed the "nice" "From" field.

            Hopefully, I can now move on. Thanks for everyone’s patience.
            Matt