#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    PHP Mailer Sending files From Checkboxes


    I'm trying to build a form for my website where users would go to the page, click checkboxes corresponding to various documents, and after entering their name and email address, they would be sent an email with the files attached, and I'd be emailed their information (or have the info go in a database).

    Most files are relatively small and emailable, although I would also consider having the email just have links in the body of it that a user could click on to download the files if that is easier to do.

    I've put together a basic form in Dreamweaver. What I need help with is finding/editing a php script to actually make the form functional and do what I'd like. From what I've read, it sounds like the phpmailer script is what I want, sending the data to my gmail account, but I'm confused on how to set it up with the functionality I want.

    Thanks!


    Code:
    <body>
    <p>Select Your Files...</p>
    	
    <form id="form1" name="form1" method="post" action="">
      <p>
        <input type="checkbox" name="DocumentA" id="DocumentA" />
        <label for="DocumentA">Document A</label>
      </p>
      <p>
        <input type="checkbox" name="DocumentB" id="DocumentB" />
        <label for="DocumentB">Document B</label>
      </p>
      <p>
        <input type="checkbox" name="DocumentC" id="DocumentC" />
        <label for="DocumentC">Document C</label>
      </p>
      <p>
        <input type="checkbox" name="DocumentD" id="DocumentD" />
        <label for="DocumentD">Document D</label>
      </p>
      <p>
        <label for="Name">Name:</label>
        <input type="text" name="Name" id="Name" />
      </p>
      <p>
        <label for="Email">Email:</label>
        <input type="text" name="Email" id="Email" />
      </p>
      <p>
        <label for="Comments">Comments:</label>
        <input type="text" name="Comments" id="Comments" />
      </p>
      
      <p>
        <input type="reset" name="Reset" id="Reset" value="Reset" />
        <input type="submit" name="Reset" id="Reset" value="Submit" />
      </p>
    </form>
    </body>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    8
    Rep Power
    0

    Do things step by step


    It's fairly complex to build a multipart MIME email with files attached. I don't know phpmailer; I assume it can do this for you but it would be far simpler to embed links in a plain text email. You wouldn't need anything more than the standard PHP mail() command. At least start that way and once you have it working you can always get more ambitious. (It's not clear from your post whether you've already tried this.)

    Do things step by step. If you want to use phpmailer, start by doing the very minimum with it. Write a script that just sends a test message, then look into how to add attachments.

IMN logo majestic logo threadwatch logo seochat tools logo