We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30741
    • 65 Posts
    I need to setup eform to use SMTP, but to do that seems a bit complex, wouldn’t it be easier for eform.inc.php to simply read the phpmailer for settings? If so how could we do that simply?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Actually making eForm do SMTP is quite easy. There are three places in the eform.inc.php file where the phpmailer class is configured. Just replace the $mail->IsMail(); lines with $mail->isSMTP(); and add a line:
      $mail->isSMTP();
      $mail->Host = 'smtp.maildomain.com';

        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
        • 30741
        • 65 Posts
        I cannot get eform to work -
        I replaced the values with -
        $mail->isSMTP();
        $mail->Host = ’mail.mydomain.net’;
        $mail->User = ’[email protected]’;
        $mail->Password = ’mypassword;

        But it won’t send.

        I replaced in the 4 places the line - $mail->IsMail();
        if ($mobile && $mobiletext) {
        $mobiletext = formMerge($mobiletext,$fields);
        $mail = new PHPMailer();
        $mail->IsMail();
        $mail->CharSet = $modx->config[’modx_charset’];
        $mail->IsHTML($isHtml);
        $mail->From = $from;
        $mail->FromName = $fromname;
        $mail->Subject = $subject;
        $mail->Body = $mobiletext;
        AddAddressToMailer($mail,"to",$mobile);
        $mail->send();

        What am I doing wrong?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Are you sure you need the username/password? So far in every site I’ve made this change for, all that was needed was the server name. Since the mail was coming from the same server, it didn’t want the username/password.
            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
            • 30741
            • 65 Posts
            Yea I tried it. I only allow authentication to my mail server. I did try it but no luck.
            So anyone have any other thoughts?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              no, sorry, I’ve never had it not work like that. Your mail logs should have something, though, as long as you’re sure you’ve got the mail server’s name correct and it’s actually trying to connect.
                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
                • 30741
                • 65 Posts
                Just keep getting no authentication -
                8 20:45:00[0] Rejected 127.0.0.1 FROM:<[email protected]> <undefined> 0 g_smpt_noauth "ÿÿÿÿ"

                So I have built a server that can’t send mail without authentication, but now I can’t send mail from eform. Any good ideas... Anyone?