We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4966
    • 143 Posts
    I read the post in the eForm forum and did a seach but I’m still lost on how to create a form where the user can upload/attach a image. Is there a tutorial somewhere?

    charlie-imac
      • 34017
      • 898 Posts
      charlie,

      There are 2 main steps involved and it should work automagically.

      1. Put this in the top of your form: enctype="multipart/form-data"
      2. Download the latest phpmailer script (http://phpmailer.sourceforge.net/)

      Another good starting point (tho you might’ve seen it already- ie good links) - http://modxcms.com/forums/index.php/topic,2122.0.html

      Chuck
        Chuck the Trukk
        ProWebscape.com :: Nashville-WebDesign.com
        - - - - - - - -
        What are TV's? Here's some info below.
        http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
        http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
        • 4966
        • 143 Posts
        thanks! I have a couple of problems:

        1. I do not want to install phpmailer in my php path. it is included in the php local path for my modx website. I edited the class.phpmailer.php file pointed to by eform.inc.php line 367 - manager/includes/controls/class.phpmailer.php. I can send email from the snippets/eform directory. How or what do I need to do to tell eform to use this class.phpmailer.php file. I’m getting email but it is from postfix on the mac and not phpmailer.

        2. I have the following in my eFeedbackForm chunck
        <p><input type="file" name="image" eform=" Your image:file:1"></p>
        and <tr valign="top"><td>file/image:</td><td>[+image+]</td></tr> in my eFeedBackReport chunck. I never receiving a file. May have to do with one. I do get the email with the other fields.

        charlie-imac
          • 34017
          • 898 Posts
          I dont think you would need the following in your feeback report:

          <input type="file" name="image" eform=" Your image:file:1">

          It should work without this, and you have to use the newest phpmailer (but i dont know how to direct you on your phpmailer questions).

          Chuck
            Chuck the Trukk
            ProWebscape.com :: Nashville-WebDesign.com
            - - - - - - - -
            What are TV's? Here's some info below.
            http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
            http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
            • 30223
            • 1,010 Posts
            I don’t understand what you’re saying in your first question. Phpmailer comes installed with MODx and eForm expects it to be where MODx installs it.
            Can you explain what you don’t want a bit more?
              • 4966
              • 143 Posts
              sorry for the confusion. thought i had to install phpmailer. went to the manager/includes/control directory and edited the class.phpmailer.php to use smtp and our mailer server with smtp autorization. wrote a small program to test phpmailer using the class.phpmailer.php file and works great. when i use eform get mail kicked back by postfix. would like for eform to work the same way as testfile.

              testmail.php
              <?php

              require("class.phpmailer.php");

              $mail = new PHPMailer();

              $mail->From = "[email protected]";

              $mail->FromName = "Mailer";

              $mail->AddAddress("[email protected]", "charlie-imac");

              $mail->WordWrap = 50; // set word wrap to 50 characters

              $mail->IsHTML(true); // set email format to HTML

              $mail->Subject = "Here is the subject";

              $mail->Body = "This is the HTML message body <b>in bold!</b>";

              $mail->AltBody = "This is the body in plain text for non-HTML mail clients";

              if(!$mail->Send())

              {
              echo "Message could not be sent. <p>";

              echo "Mailer Error: " . $mail->ErrorInfo;

              exit;
              }
              echo "Message has been sent";
              ?>

              charlie-imac
                • 30223
                • 1,010 Posts
                So what’s the error from postfix?

                In your eForm snippet call set the &debug parameter (values can be 1,2 or 3 with increasing debugging details). This will give you a list of the mail headers eForm provides to phpmailer. perhaps that will give you something to start from.



                  • 4966
                  • 143 Posts
                  Never did get an error just never received a email. Ended up replacing lines 371-388 with code from my external file and everything worked. Never did figure out why the problem but it’s working now. go figure. thanks for the support.

                  charlie-imac