We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    hi guys, my standard contact form works but for some reason my host only allows emails to mailboxes i have with the host, if i try to send to another email address it won’t work. the weird thing is when i have used a php contact form in the past it will let me send emails anywhere, and on my subdomains with same provider it lets me send them anywhere again with a php or standard contact form. so why am i stuck to only emails that i have an email box for on this modx site with eform? i really want to be able to send emails to different people from different forms on different pages on my site. please if anyone can advise. thanks.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      They block outside mail from the php mail() function which is what eForm uses by default. The other forms you use probably use SMTP or direct sendmail calls.
        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
        • 34162
        • 1 Posts
        thanks for your reply, yeah they are blocking everything cept one root mail box i have with them. is there another way i could add forms to different pages so that the people on those pages could be contacted by email. is there a mod i can use to have it use sendmail or something? my skills aren’t very good so i really need a fairly simple solution. maybe there is a different mailer than eform i can use?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Eform uses the phpmailer class that is in manager/includes/controls/class.phpmailer.php. This is a fairly serious mailer class, and supports a number of mailing methods. I’m not sure if anyone has adapted eForm to use any of the other options.

          Line 355 of eForm specifies using the mail() function:
          $mail->IsMail();
          

          It could use IsSMTP(), IsSendmail() or IsQmail() instead, although I believe that these require some account name and passwords passed to it as well.

          This looks quite interesting, and not too difficult to add...

          http://www.corephp.co.uk/archives/18-POP-before-SMTP-Authentication-for-PHPMailer.html
            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
            • 34162
            • 1 Posts
            it’s weird though on various subdomains i use a php contact form and no authentication is required, the form sends the details the php page which emails it, but i can’t have loads of these php pages as well sending to different places it’ll get too confusing, i need the email recipient addy on that page so i can see what’s going on and easily update different people’s contact forms...
              • 211
              • 13 Posts
              I’ve seen a coupla posts in this form for this error

              mb_send_mail() [function.mb-send-mail]: Unsupported charset ""UTF-8""

              but not of the fixes work for me

              I’m using eForm 1.4.3

              I upgraded the default snippet.

              even tried to change the class.phpmailer.php

              Charset default to UTF-8

              (even tried changeing caps) nothing doing
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                  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
                  • 211
                  • 13 Posts
                  Looked it up and tried to follow the example.

                  No luck. So I reset my PHP.ini settings and restart Apache. Still nothing. Same error message.

                  Could you help me sort this out. I know its probably something really simple I’m not doing.

                  These are my PHP Ini settings

                  
                  [mbstring]
                  ; language for internal character representation.
                  mbstring.language = "Neutral"
                  
                  ; internal/script encoding.
                  ; Some encoding cannot work as internal encoding.
                  ; (e.g. SJIS, BIG5, ISO-2022-*)
                  mbstring.internal_encoding = "UTF-8"
                  
                  ; http input encoding.
                  mbstring.http_input = "auto"
                  
                  ; http output encoding. mb_output_handler must be
                  ; registered as output buffer to function
                  mbstring.http_output = "UTF-8"
                  
                  ; enable automatic encoding translation accoding to 
                  ; mbstring.internal_encoding setting. Input chars are
                  ; converted to internal encoding by setting this to On.
                  ; Note: Do _not_ use automatic encoding translation for
                  ;       portable libs/applications.
                  mbstring.encoding_translation = On
                  
                  ; automatic encoding detection order.
                  ; auto means 
                  mbstring.detect_order = "auto"
                  
                  ; substitute_character used when character cannot be converted
                  ; one from another
                  mbstring.substitute_character = 12307
                  
                  ; overload(replace) single byte functions by mbstring functions.
                  ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
                  ; etc. Possible values are 0,1,2,4 or combination of them.
                  ; For example, 7 for overload everything.
                  ; 0: No overload
                  ; 1: Overload mail() function
                  ; 2: Overload str*() functions
                  ; 4: Overload ereg*() functions
                  mbstring.func_overload = 7
                  
                  
                    • 211
                    • 13 Posts
                    Still no luck on the forms. So I reverted to eForm 1.4.1. Also for some reason whenever I put in a specific email address in the to variable the processing doesnt work. Whereas if I leave it as emailsender it works. Processes and send through to thank you page.

                    But no email arrives. Please advise. Where do I configure emailsender : main website email under configuration? Thats done. But still no email recepit.

                    Please find my code below
                    [[ContactForm? &sendTo=`[(emailsender)]`]]
                    
                    [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[(email_sender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`46`  !]
                    


                    is it a problem with my phpmailer settings.

                    this is whats in my file. Do I need to set up the settings for SMTP etc?

                    <?php
                    ////////////////////////////////////////////////////
                    // PHPMailer - PHP email class
                    //
                    // Class for sending email using either
                    // sendmail, PHP mail(), or SMTP.  Methods are
                    // based upon the standard AspEmail(tm) classes.
                    //
                    // Copyright (C) 2001 - 2003  Brent R. Matzelle
                    //
                    // License: LGPL, see LICENSE
                    ////////////////////////////////////////////////////
                    
                    /**
                     * PHPMailer - PHP email transport class
                     * @package PHPMailer
                     * @author Brent R. Matzelle
                     * @copyright 2001 - 2003 Brent R. Matzelle
                     */
                    class PHPMailer
                    {
                        /////////////////////////////////////////////////
                        // PUBLIC VARIABLES
                        /////////////////////////////////////////////////
                    
                        /**
                         * Email priority (1 = High, 3 = Normal, 5 = low).
                         * @var int
                         */
                        var $Priority          = 3;
                    
                        /**
                         * Sets the CharSet of the message.
                         * @var string
                         */
                        var $CharSet           = "iso-8859-1";
                    
                        /**
                         * Sets the Content-type of the message.
                         * @var string
                         */
                        var $ContentType        = "text/plain";
                    
                        /**
                         * Sets the Encoding of the message. Options for this are "8bit",
                         * "7bit", "binary", "base64", and "quoted-printable".
                         * @var string
                         */
                        var $Encoding          = "8bit";
                    
                        /**
                         * Holds the most recent mailer error message.
                         * @var string
                         */
                        var $ErrorInfo         = "";
                    
                        /**
                         * Sets the From email address for the message.
                         * @var string
                         */
                        var $From               = "root@localhost";
                    
                        /**
                         * Sets the From name of the message.
                         * @var string
                         */
                        var $FromName           = "Root User";
                    
                        /**
                         * Sets the Sender email (Return-Path) of the message.  If not empty,
                         * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
                         * @var string
                         */
                        var $Sender            = "";
                    
                        /**
                         * Sets the Subject of the message.
                         * @var string
                         */
                        var $Subject           = "";
                    
                        /**
                         * Sets the Body of the message.  This can be either an HTML or text body.
                         * If HTML then run IsHTML(true).
                         * @var string
                         */
                        var $Body               = "";
                    
                        /**
                         * Sets the text-only body of the message.  This automatically sets the
                         * email to multipart/alternative.  This body can be read by mail
                         * clients that do not have HTML email capability such as mutt. Clients
                         * that can read HTML will view the normal Body.
                         * @var string
                         */
                        var $AltBody           = "";
                    
                        /**
                         * Sets word wrapping on the body of the message to a given number of 
                         * characters.
                         * @var int
                         */
                        var $WordWrap          = 0;
                    
                        /**
                         * Method to send mail: ("mail", "sendmail", or "smtp").
                         * @var string
                         */
                        var $Mailer            = "mail";
                    
                        /**
                         * Sets the path of the sendmail program.
                         * @var string
                         */
                        var $Sendmail          = "/usr/sbin/sendmail";
                        
                        /**
                         * Path to PHPMailer plugins.  This is now only useful if the SMTP class 
                         * is in a different directory than the PHP include path.  
                         * @var string
                         */
                        var $PluginDir         = "";
                    
                        /**
                         *  Holds PHPMailer version.
                         *  @var string
                         */
                        var $Version           = "1.73";
                    
                        /**
                         * Sets the email address that a reading confirmation will be sent.
                         * @var string
                         */
                        var $ConfirmReadingTo  = "";
                    
                        /**
                         *  Sets the hostname to use in Message-Id and Received headers
                         *  and as default HELO string. If empty, the value returned
                         *  by SERVER_NAME is used or 'localhost.localdomain'.
                         *  @var string
                         */
                        var $Hostname          = "";
                    
                        /////////////////////////////////////////////////
                        // SMTP VARIABLES
                        /////////////////////////////////////////////////
                    
                        /**
                         *  Sets the SMTP hosts.  All hosts must be separated by a
                         *  semicolon.  You can also specify a different port
                         *  for each host by using this format: [hostname:port]
                         *  (e.g. "smtp1.example.com:25;smtp2.example.com").
                         *  Hosts will be tried in order.
                         *  @var string
                         */
                        var $Host        = "localhost";
                    
                        /**
                         *  Sets the default SMTP server port.
                         *  @var int
                         */
                        var $Port        = 25;
                    
                        /**
                         *  Sets the SMTP HELO of the message (Default is $Hostname).
                         *  @var string
                         */
                        var $Helo        = "";
                    
                        /**
                         *  Sets SMTP authentication. Utilizes the Username and Password variables.
                         *  @var bool
                         */
                        var $SMTPAuth     = false;
                    
                        /**
                         *  Sets SMTP username.
                         *  @var string
                         */
                        var $Username     = "";
                    
                        /**
                         *  Sets SMTP password.
                         *  @var string
                         */
                        var $Password     = "";
                    
                        /**
                         *  Sets the SMTP server timeout in seconds. This function will not 
                         *  work with the win32 version.
                         *  @var int
                         */
                        var $Timeout      = 10;
                    
                        /**
                         *  Sets SMTP class debugging on or off.
                         *  @var bool
                         */
                        var $SMTPDebug    = false;
                    
                        /**
                         * Prevents the SMTP connection from being closed after each mail 
                         * sending.  If this is set to true then to close the connection 
                         * requires an explicit call to SmtpClose(). 
                         * @var bool
                         */
                        var $SMTPKeepAlive = false;
                    
                        /**#@+
                         * @access private
                         */
                        var $smtp            = NULL;
                        var $to              = array();
                        var $cc              = array();
                        var $bcc             = array();
                        var $ReplyTo         = array();
                        var $attachment      = array();
                        var $CustomHeader    = array();
                        var $message_type    = "";
                        var $boundary        = array();
                        var $language        = array();
                        var $error_count     = 0;
                        var $LE              = "\n";
                        /**#@-*/
                        
                        /////////////////////////////////////////////////
                        // VARIABLE METHODS
                        /////////////////////////////////////////////////
                    
                        /**
                         * Sets message type to HTML.  
                         * @param bool $bool
                         * @return void
                         */
                        function IsHTML($bool) {
                            if($bool == true)
                                $this->ContentType = "text/html";
                            else
                                $this->ContentType = "text/plain";
                        }
                    
                        /**
                         * Sets Mailer to send message using SMTP.
                         * @return void
                         */
                        function IsSMTP() {
                            $this->Mailer = "smtp";
                        }
                    
                        /**
                         * Sets Mailer to send message using PHP mail() function.
                         * @return void
                         */
                        function IsMail() {
                            $this->Mailer = "mail";
                        }
                    
                        /**
                         * Sets Mailer to send message using the $Sendmail program.
                         * @return void
                         */
                        function IsSendmail() {
                            $this->Mailer = "sendmail";
                        }
                    
                        /**
                         * Sets Mailer to send message using the qmail MTA. 
                         * @return void
                         */
                        function IsQmail() {
                            $this->Sendmail = "/var/qmail/bin/sendmail";
                            $this->Mailer = "sendmail";
                        }
                    
                    
                    
                    


                    Please assist, I’d appreciate it.
                      • 3843
                      • 15 Posts
                      First of all, sorry for my english

                      I think, i found a little bug in eForm 1.4.4.

                      I need to check email of sender (value is not necessary for my form). In form i created an input with eform="Е-mail:email:0:". But when i test the form with wrong email value - i get an empty error message.
                      Then i look for $vMsg array by print_r function - i found where value zero with empty value. I explore the code and found

                      $vMsg[count($vMsg)] = isset($formats[$name][4]) ? $formats[$name][4] : $desc . $_lang["ef_invalid_email"];


                      this code not work correctly in my case and was replaced by:

                      $vMsg[count($vMsg)] = !empty($formats[$name][4]) ? $formats[$name][4] : $desc . $_lang["ef_invalid_email"];


                      Best regards, Sergei

                      This discussion is closed to further replies. Keep calm and carry on.