Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2012
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Email Project

    I'm trying to implement a javascript program into an html environment. I'm having trouble trying to figure out how to write the program.

    Essentially, I want to have a bunch of document icons on a page. There would be a checkbox next to each document. Check all the appropriate documents one wants to send to someone. Click "Generate Email" and an Outlook (or default mailer) email would be created with said documents attached.

    Please note that this site will be maintained on an Intranet, and won't be public. Only employees will have access to it.



    Any ideas where I can start?

    -Jared
    (JPC Solutions)

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,898
    Thanks
    203
    Thanked 2,530 Times in 2,508 Posts
    This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others, but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

    You seem to be contemplating using the long-obsolete mailto:. Modern browsers no longer accept mailto: as a form action - they simply open the email program (if any) and ignore the form. If you are going to use a form then use a server-side CGI formmail script as the action - there are several good free ones out there.

    Be aware that mailto: does not provide any way to include an attachment.


    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Banned
    Join Date
    Oct 2012
    Posts
    81
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by jpcsolutions View Post

    Any ideas where I can start?
    I'm guessing you're not actually looking for someone to write the code for you, so here are a few tips on how you can go about starting your project.

    1. Markup the html to display the image icons, checkboxes and button in a form.

    2. Each document should have a unique id value, if the docs are retrieved from a database, which should be set to the value of the doc's checkbox.

    3. If the doc's meta data is not stored in a database you can use the doc's file name as the checkbox value.

    4. Give all the doc checkboxes the same name so that the selected id's or file names can be sent as an array of values to a server side script (PHP can send email attachments very easily) that will send out the email with attachments.

    5. The server side script will loop through the array of doc values sent to it, append all the attachments to an email and then send it out. If you will be using php then all of the above can be done in 2-3 hours max from go to whoa for someone who knows html, css and php. You don't need javascript at all for your project unless you want to do some optional client side data validation.

    6. All validation must be done server side using php or your preferred server side language.
    Last edited by minder; 11-10-2012 at 10:14 PM.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •