Can Javascript send emails??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard H

    Can Javascript send emails??

    Hi,

    I am building a site for a client which has an enquiry form on it.
    Normally I would something like PHP to send the form but the client doesn't
    want to pay for a server that supports PHP, so the form is sent using the
    mailto: command within the <form> tag. This sends the email fine but it is
    rather messey. Could I use javascript to tidy up the form output and then
    send an email with the contents, similar to the 'Mail' command in PHP?

    Any help or advice greatly received!!


  • Grant Wagner

    #2
    Re: Can Javascript send emails??

    Richard H wrote:
    [color=blue]
    > Hi,
    >
    > I am building a site for a client which has an enquiry form on it.
    > Normally I would something like PHP to send the form but the client doesn't
    > want to pay for a server that supports PHP, so the form is sent using the
    > mailto: command within the <form> tag. This sends the email fine but it is
    > rather messey. Could I use javascript to tidy up the form output and then
    > send an email with the contents, similar to the 'Mail' command in PHP?[/color]

    "Rather messy" is an understatement.

    Using mailto: implies the existance and proper configuration of a "default
    E-mail client", something not everyone has available to them. Worse still, the
    very people who are having problems with your customer's Web site are the ones
    most in need of contact with them, and the ones least likely to be able to do
    so.

    Tell your client to cough up the extra bucks for PHP or Perl support with their
    Web hosting provider and do it correctly.

    Client-side JavaScript is not going to allow you to clean up the resulting
    E-mail in any way, use a proper server-side solution.

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • Michael Winter

      #3
      Re: Can Javascript send emails??

      On Wed, 15 Sep 2004 18:21:47 GMT, Grant Wagner
      <gwagner@agrico reunited.com> wrote:

      [snip]
      [color=blue]
      > Tell your client to cough up the extra bucks for PHP or Perl support
      > with their Web hosting provider and do it correctly.[/color]

      If they really want to do it on the cheap, they could use one of the free
      services, or one which offers form mail at a lower cost than full
      server-side support (if you expect high traffic).

      To Richard:

      I've seen free web hosts provide form mail, even if PHP was out of the
      question. It might be an idea to see if your client's host provides a
      script already.

      [snip]

      Mike

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail.

      Comment

      • Andrew DeFaria

        #4
        Re: Can Javascript send emails??

        Grant Wagner wrote:
        [color=blue]
        > Tell your client to cough up the extra bucks for PHP or Perl support
        > with their Web hosting provider and do it correctly.[/color]

        I have run PHP on Linux and Perl on both Linux and Windows (I believe
        there's also a PHP that runs on Windows). Never had to "cough up" any
        bucks at all? Where are you guys getting PHP and/or Perl and coughing up
        money?
        --
        Future historians will be able to study at the Gerald Ford Library; the
        Jimmy Carter Library; the Ronald Reagan Library and the Bill Clinton
        Adult Bookstore.

        Comment

        • Dag Sunde

          #5
          Re: Can Javascript send emails??

          "Andrew DeFaria" <Andrew@DeFaria .com> wrote in message
          news:5e06d$4148 ec54$c09cfcf$22 221@msgid.megan ewsservers.com. ..[color=blue]
          > Grant Wagner wrote:
          >[color=green]
          > > Tell your client to cough up the extra bucks for PHP or Perl support
          > > with their Web hosting provider and do it correctly.[/color]
          >
          > I have run PHP on Linux and Perl on both Linux and Windows (I believe
          > there's also a PHP that runs on Windows). Never had to "cough up" any
          > bucks at all? Where are you guys getting PHP and/or Perl and coughing up
          > money?[/color]

          If you look closer, he wrote:
          "...PHP or Perl support with their Web hosting provider..."

          most web host charge extra if you want db-access or server side scripting
          abilities in addition to the web space.

          --
          Dag
          58°26'15.9" N 008°46'45.5" E


          Comment

          • Richard H

            #6
            Re: Can Javascript send emails??

            To be honest PHP is by far my prefered solution, but i am yet to find anyone
            that allows server side scripting for free!!

            Main problem is that the client picked and paid for his hosting before I got
            involved. He had just purchased a mac (shudder) and so wants to host with
            ..mac. This is fine but i can not find anywhere whether they allow server
            side or not! There set up is very much idiots guide to hosting your first
            webpage. Anyone know whether .mac allow server side, or even how to contact
            them to find out?? (they don't seem to have a contact address on their
            site).

            Failing all else I will have to trust the user has an email programme and
            tell my client to deal with the mess!!

            Thanks for all your help!


            Comment

            • Robert

              #7
              Re: Can Javascript send emails??

              In article <cibp5h$13u$1@a thena.ukc.ac.uk >,
              "Richard H" <rjth3@kent.ac. uk> wrote:
              [color=blue]
              > To be honest PHP is by far my prefered solution, but i am yet to find anyone
              > that allows server side scripting for free!![/color]

              Have you looked at the free form processing site. For example, see:



              These sites will forward your form data in an email.

              Here is where I got the above sites.


              &btnG=Google+Se arch

              This search was gotten from ~kaeli~.

              The server program cgiemail process form data on a server. See:


              mindspring.com has a grandfathered version of cgiemail.
              [color=blue]
              > Main problem is that the client picked and paid for his hosting before I got
              > involved. He had just purchased a mac (shudder)[/color]
              Wise move by the way.[color=blue]
              > and so wants to host with
              > .mac. This is fine but i can not find anywhere whether they allow server
              > side or not! There set up is very much idiots guide to hosting your first
              > webpage. Anyone know whether .mac allow server side, or even how to contact
              > them to find out?? (they don't seem to have a contact address on their
              > site).[/color]

              Well, he didn't spend much money on .mac. Tell him he needs a form
              server. Find some other server with cgiemail on it.

              Robert

              Comment

              • Andrew Thompson

                #8
                Re: Can Javascript send emails??

                On Thu, 16 Sep 2004 16:56:45 GMT, Robert wrote:
                [color=blue]
                > http://www.google.com/search?hl=en&l...free+form+mail
                > &btnG=Google+Se arch[/color]

                Link tips..

                A lot of what is in the Google links is unnecessary..

                The link above, after we dump all the junk
                Google themselves add into it, becomes..
                <http://www.google.com/search?q=free+f orm+mail>
                ...but those 14,300,000 can be trimmed to be
                a bit more specific with this search..
                <http://www.google.com/search?q=free+" form+mail">
                (54,800)

                And.. even if you cannot trim a long link,
                you can protect it from being broken by news
                reader software simply by enclosing it in '<' '>'
                <http://www.google.com/search?hl=en&lr =&ie=UTF-8&oe=utf-8&q=free+form+m ail&btnG=Google +Search>

                HTH

                --
                Andrew Thompson
                http://www.PhySci.org/codes/ Web & IT Help
                http://www.PhySci.org/ Open-source software suite
                http://www.1point1C.org/ Science & Technology
                http://www.lensescapes.com/ Images that escape the mundane

                Comment

                • Randy Webb

                  #9
                  Re: Can Javascript send emails??

                  Andrew DeFaria wrote:[color=blue]
                  > Grant Wagner wrote:
                  >[color=green]
                  >> Tell your client to cough up the extra bucks for PHP or Perl support
                  >> with their Web hosting provider and do it correctly.[/color]
                  >
                  >
                  > I have run PHP on Linux and Perl on both Linux and Windows (I believe
                  > there's also a PHP that runs on Windows). Never had to "cough up" any
                  > bucks at all? Where are you guys getting PHP and/or Perl and coughing up
                  > money?[/color]

                  Yes, PHP runs on Windows, and quite well.

                  --
                  Randy
                  comp.lang.javas cript FAQ - http://jibbering.com/faq

                  Comment

                  • Grant Wagner

                    #10
                    Re: Can Javascript send emails??

                    Randy Webb wrote:
                    [color=blue]
                    > Andrew DeFaria wrote:[color=green]
                    > > Grant Wagner wrote:
                    > >[color=darkred]
                    > >> Tell your client to cough up the extra bucks for PHP or Perl support
                    > >> with their Web hosting provider and do it correctly.[/color]
                    > >
                    > >
                    > > I have run PHP on Linux and Perl on both Linux and Windows (I believe
                    > > there's also a PHP that runs on Windows). Never had to "cough up" any
                    > > bucks at all? Where are you guys getting PHP and/or Perl and coughing up
                    > > money?[/color]
                    >
                    > Yes, PHP runs on Windows, and quite well.[/color]

                    *Sigh*.

                    The original post read (in part): "... I am building a site for a client which
                    has an enquiry form on it. Normally I would something like PHP to send the
                    form but the client doesn't want to pay for a server that supports PHP, ..."

                    So it was the original poster who indicated that his client did not want to
                    pay for a Web hosting provider that supported PHP.

                    My response was: "Tell your client to cough up the extra bucks for PHP or Perl
                    support with their Web hosting provider and do it correctly."

                    I thought the whole "... support with their Web hosting provider ..." was
                    adequate to explain I am talking about his client's choice to host their Web
                    site on a provider who does not offer PHP support for the money they are
                    paying. Web hosting providers will sometimes charge more for PHP or other
                    server-side technologies over and above what they would charge for bare-bones
                    HTML only Web hosting (when and if they offer various service levels).

                    His client downloading and installing either Perl or PHP on either Linux or
                    Windows at no cost might be a great victory for the open sores software
                    movement, they might even be able to put together a kickass screaming site
                    that runs off http://localhost. But it does his client NO GOOD WHATSOEVER
                    because none of the code written will do what it is supposted to on their
                    choice of Web hosting provider because they are not paying that Web hosting
                    provider for PHP support.

                    So yes, if I want PHP support on a publically accessible Web site hosted by a
                    3rd party, I will most certainly have to "cough up the bucks" if I want an
                    appropriate amount of storage, bandwidth, administrative tools, back-end
                    database, site logging and no Web hosting provider inserted ads (which is what
                    you'd want if you are a business running a Web site).

                    --
                    Grant Wagner <gwagner@agrico reunited.com>
                    comp.lang.javas cript FAQ - http://jibbering.com/faq

                    Comment

                    • Ian Sedwell

                      #11
                      Re: Can Javascript send emails??

                      On 2004/09/15 18:37, in article ci9uj1$n8f$1@at hena.ukc.ac.uk, "Richard H"
                      <rjth3@kent.ac. uk> wrote:
                      [color=blue]
                      > Hi,
                      >
                      > I am building a site for a client which has an enquiry form on it.
                      > Normally I would something like PHP to send the form but the client doesn't
                      > want to pay for a server that supports PHP, so the form is sent using the
                      > mailto: command within the <form> tag. This sends the email fine but it is
                      > rather messey. Could I use javascript to tidy up the form output and then
                      > send an email with the contents, similar to the 'Mail' command in PHP?
                      >
                      > Any help or advice greatly received!!
                      >
                      >[/color]

                      Hi Richard

                      Do it in Perl. Assuming that your HTML form is all up and running and you
                      have your JavaScript validation routines written, then putting a Perl script
                      behind it is by far the easiest solution. There are plenty of freebie
                      scripts (check out Google) or since you're in the UK like me, send me an
                      email with your email specification, I'll send you back a working script
                      within within the day and invoice you £100.

                      On the other hand... You will kick yourself when you see how easy it is when
                      you do it yourself :-)

                      Have fun!

                      Ian

                      Comment

                      • cwdjr

                        #12
                        Re: Can Javascript send emails??

                        The host I use for my domain in the US gives me 1000MB disc space and
                        5000MB bandwidth per month for about US$10 per month on a yearly
                        basis. They have other plans with more storage and bandwidth for more,
                        or you can just buy extra bandwidth. A am on a Unix server, but
                        Microsoft ones are available for a bit more. CGI form mail is a snap
                        on the Unix server. It is included in the monthly fee. You just go to
                        the control panel page and click a button to install CGI form mail(or
                        a guest book, etc.). When you go to the web shell you will find
                        everything all set up in the cgi-bin along with example pages of how
                        to write the html form mail page for specific user input. If you want
                        to write your own CGI with perl, etc, there is an additional charge
                        for this. Unless you are very experienced in CGI and perl it may be
                        best to use the standard form mail provided by the host to avoid
                        possible hacks. The host also has several pop mail accounts associated
                        with your domain in the basic package. The feedback from the form gets
                        stored as pop3 mail that you can recover at many eMail hosts,
                        including the free Yahoo one. If I were in your situation, I would get
                        an account on a new host and dump the old one as soon as I could.
                        Perhaps other uses could be found for the old account until it
                        expires. Also, for business use, look for a host that has many more
                        optional pay features in case you ever need them - these can include
                        secure pages, shopping carts, etc. that can be installed very easily.
                        There is a glut of hosts, but it is well worth the time to sort
                        through many until you find the one just right for you.

                        Comment

                        • Dr John Stockton

                          #13
                          Re: Can Javascript send emails??

                          JRS: In article <414B5E4C.6622F E3D@agricoreuni ted.com>, dated Fri, 17
                          Sep 2004 21:57:34, seen in news:comp.lang. javascript, Grant Wagner
                          <gwagner@agrico reunited.com> posted :
                          [color=blue]
                          >So yes, if I want PHP support on a publically accessible Web site hosted by a
                          >3rd party, I will most certainly have to "cough up the bucks" if I want an
                          >appropriate amount of storage, bandwidth, administrative tools, back-end
                          >database, site logging and no Web hosting provider inserted ads (which is what
                          >you'd want if you are a business running a Web site).[/color]

                          No spelling-checker in your news-composing system, then?

                          <URL:http://www.merlyn.demo n.co.uk/mail-use.htm> may help.

                          What is *really* needed is an HTML- and script- aware checker, that can
                          be used on the source of a page (one would not expect checking of
                          computed strings).

                          --
                          © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                          <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                          <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                          <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                          Comment

                          • Ian Sedwell

                            #14
                            Re: Can Javascript send emails??

                            On 2004/09/16 11:17, in article cibp5h$13u$1@at hena.ukc.ac.uk, "Richard H"
                            <rjth3@kent.ac. uk> wrote:
                            [color=blue]
                            > To be honest PHP is by far my prefered solution, but i am yet to find anyone
                            > that allows server side scripting for free!!
                            >
                            > Main problem is that the client picked and paid for his hosting before I got
                            > involved. He had just purchased a mac (shudder) and so wants to host with
                            > .mac. This is fine but i can not find anywhere whether they allow server
                            > side or not! There set up is very much idiots guide to hosting your first
                            > webpage. Anyone know whether .mac allow server side, or even how to contact
                            > them to find out?? (they don't seem to have a contact address on their
                            > site).
                            >
                            > Failing all else I will have to trust the user has an email programme and
                            > tell my client to deal with the mess!!
                            >
                            > Thanks for all your help!
                            >
                            >[/color]

                            If it's a MacOS X server (hooray), it will have Apache (hooray) and is rock
                            solid reliable, virtually crash proof and F A S T.

                            Windows sucks, Linux is cool, Unix is good. Amen

                            Comment

                            Working...