This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript E-Mail Form Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "JavaScript E-Mail Form" Watch "JavaScript E-Mail Form" New topic
Author

JavaScript E-Mail Form

Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
I'm trying to build a JS email form so that the user doesn't need to have access to his/her own e-mail system (outlook or whatever), and I can't use cgi or perl. So far, everything I've tried immediately pulls up my email address from outlook on my computer, and when I'm not on my computer, Outlook wants me to create a new profile.
How do I get around that? CAN I get around that?
The reason for doing this is that the page I'm building has to be able to be used from, say, a hotel's or library's computer.
Thank you very much for any assistance you can provide. If there is another way, say through php (never used, but always willing to move in a new direction), that would be helpful, too.
Thanks much!
Pat Flickner
eammon bannon
Ranch Hand

Joined: Mar 16, 2004
Posts: 140

CAN I get around that?

No. You don't specify this, but I assume you are runing the JS client-side? In which case you only have access to client side resources, and your only route to an SMTP server is what ever MUA (Mail User Agent) is installed as the default. What you would need to do is submit the form to a piece of serverside code (written in whatever language you feel like) which creates the email.
The only route I can think of to keep things client side is possible ActiveX - in which case (assuming the user was happy to install your component, and assuming they use an MS MUA) you could script it to send the email without visibly bringing up the MUA. Not a good solution.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
you can use jsp, php, asp, .net, cgi to do it.
If you search google for "free email scripts (language)" you should find plenty.
just check to see what your host supports and some do not allow emails to be sent..
Eric
Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
That's what I thought. Okay, thanks a lot for your help, guys. I appreciate it.
Pat
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
you will ALWAYS need to use either a serverside solution to connect to a mailserver and send the message OR a clientside solution.
For the clientside solution your only option is to connect to an installed mailprogram on the client and use an installed account on that.
For the serverside solution you need any of the abovementioned techs and access to a mailserver.


42
 
 
subject: JavaScript E-Mail Form
 
Threads others viewed
Sending email from java. Pls Help!!!
Error with running batch file from Java class
Code for Detecting New mails in MailBox of SMTP server
How to configure hmail Server and Microsoft Outlook for testing Java Mail applications
Read receipt
developer file tools