We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7045
    • 225 Posts
    I need someone to nudge me in the correct direction to get the email functions of WebLoginPE working with SMTP. My client’s hosting company recently changed things up a little, and now I am scrambling to get the server to play nicely with MODx. I was able to get the eForms working by simply doing what was suggested to me on the following thread: http://modxcms.com/forums/index.php/topic,37727.0.html. The solution was very simple, so I would assume the solution here shouldn’t be too nasty. I have tired modding the class.phpmailer.php script, but nothing I tried worked.

    Thanks in advance
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It should be the same; at least providing that WebLoginPE uses the phpmailer class. If it doesn’t then find where it does its mailing and edit it to match the mailing part of eForm.
        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
        • 3749
        • 24,544 Posts
        Right, you shouldn’t have to touch the phpmailer file. Basically, all you need is this (with the correct parameters, of course):

                $mail = new PHPMailer();
        
                $mail->IsSMTP();
                $mail->SMTPAuth = true; //Turn on SMTP authentication
                $mail->Host = $spfSMTP_Host;
                $mail->Port = $spfSMTP_Port;
                $mail->Username = $spfSMTP_UserName; //SMTP username
                $mail->Password = $spfSMTP_Password; //SMTP password
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 7045
          • 225 Posts
          I guess I will have to find something harder to throw at you guys, because you all made this too easy. I really do appreciate it. For those of you out there with a similar problem (who are dummies like me), here is what I did. Now I am not saying this is 100% correct, but everything is working at this time.

          In the file, /assets/snippets/webloginpe/webloginpe.class.php , look for "new PHPMailer();". I believe it is in there 5 times. In fact, here are the 5 ways it appears. I figured I should modify all of them, but I could be wrong. Now if you are having this issue, then you definitely are having the same issue with eForm. Follow the link I posted above, because the solution is slightly different.

          $Reset = new PHPMailer();
          $Register = new PHPMailer();
          $Notify = new PHPMailer();
          $Pruned = new PHPMailer();
          $EmailMessage = new PHPMailer();
          


          All I did was add two lines bellow every instance of "new PHPMailer();", like below. If you require authentication, this is also where you would add that info (I think).

          $Reset = new PHPMailer();
          $Reset->IsSMTP();
          $Reset->Host = 'smtp.domain.com';
          


          Thanks for all the help everyone.