By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,460 Members | 1,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,460 IT Pros & Developers. It's quick & easy.

Can Javascript send emails??

P: n/a
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!!
Jul 23 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
Richard H wrote:
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?


"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 <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #2

P: n/a
On Wed, 15 Sep 2004 18:21:47 GMT, Grant Wagner
<gw*****@agricoreunited.com> wrote:

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


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.
Jul 23 '05 #3

P: n/a
Grant Wagner wrote:
Tell your client to cough up the extra bucks for PHP or Perl support
with their Web hosting provider and do it correctly.


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.
Jul 23 '05 #4

P: n/a
"Andrew DeFaria" <An****@DeFaria.com> wrote in message
news:5e**************************@msgid.meganewsse rvers.com...
Grant Wagner wrote:
Tell your client to cough up the extra bucks for PHP or Perl support
with their Web hosting provider and do it correctly.


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?


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
5826'15.9" N 00846'45.5" E
Jul 23 '05 #5

P: n/a
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!
Jul 23 '05 #6

P: n/a
In article <ci**********@athena.ukc.ac.uk>,
"Richard H" <rj***@kent.ac.uk> wrote:
To be honest PHP is by far my prefered solution, but i am yet to find anyone
that allows server side scripting for free!!
Have you looked at the free form processing site. For example, see:
http://www.form-mail.com/
http://www.response-o-matic.com/

These sites will forward your form data in an email.

Here is where I got the above sites.

http://www.google.com/search?hl=en&l...free+form+mail
&btnG=Google+Search

This search was gotten from ~kaeli~.

The server program cgiemail process form data on a server. See:
http://web.mit.edu/wwwdev/cgiemail/

mindspring.com has a grandfathered version of cgiemail.
Main problem is that the client picked and paid for his hosting before I got
involved. He had just purchased a mac (shudder) Wise move by the way. 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).


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
Jul 23 '05 #7

P: n/a
On Thu, 16 Sep 2004 16:56:45 GMT, Robert wrote:
http://www.google.com/search?hl=en&l...free+form+mail
&btnG=Google+Search


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+form+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+mail&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
Jul 23 '05 #8

P: n/a
Andrew DeFaria wrote:
Grant Wagner wrote:
Tell your client to cough up the extra bucks for PHP or Perl support
with their Web hosting provider and do it correctly.

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?


Yes, PHP runs on Windows, and quite well.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #9

P: n/a
Randy Webb wrote:
Andrew DeFaria wrote:
Grant Wagner wrote:
Tell your client to cough up the extra bucks for PHP or Perl support
with their Web hosting provider and do it correctly.

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?


Yes, PHP runs on Windows, and quite well.


*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 <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #10

P: n/a
On 2004/09/15 18:37, in article ci**********@athena.ukc.ac.uk, "Richard H"
<rj***@kent.ac.uk> wrote:
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!!


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

Jul 23 '05 #11

P: n/a
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.
Jul 23 '05 #12

P: n/a
JRS: In article <41***************@agricoreunited.com>, dated Fri, 17
Sep 2004 21:57:34, seen in news:comp.lang.javascript, Grant Wagner
<gw*****@agricoreunited.com> posted :
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).


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

<URL:http://www.merlyn.demon.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.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 23 '05 #13

P: n/a
On 2004/09/16 11:17, in article ci**********@athena.ukc.ac.uk, "Richard H"
<rj***@kent.ac.uk> wrote:
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!


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

Jul 23 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.