/    Sign up×
Community /Pin to ProfileBookmark

Contact form submit code – Java?

reference: http://pcnetguard.com/test9/ – Contact section

Is there a decent Java script or other method to use for the Submit button in the contact section? Im not concerned with Captcha, etc and don’t want the button to be a mailto:xxx@xxx

to post a comment
Full-stack Developer

11 Comments(s)

Copy linkTweet thisAlerts:
@emmawilliam888135Sep 17.2018 — Nice Forum! Thanks for sharing nice information with us. This Forum is very helpful for Accounting Outsourcing. If you are getting any technical issues get connected with Accounting Outsourcing number Call us now +38-443-577-647. For more information, you can click on the link: -https://accounting-outsourcing.com.ua
Copy linkTweet thisAlerts:
@rootSep 17.2018 — When asking for help, please post the code and details of what it is that is wrong or should be happening.

THEN there is this Java business, if its Java then you are in the wrong place, if it is JavaScript, then you are in the right place, if it is JQuery or similar, you are in the wrong place.

So what have you got? Java, JavaScript or JQuery or other similar library?
Copy linkTweet thisAlerts:
@Scrif2016authorSep 18.2018 — I don't have anything applied script wise to the contact form submit button. I am asking if anyone knows of a script or code that will work. ie: when someone enters their info in the contact form and they hit submit, what background script or function makes the button work and send an email to whatever I specify?
Copy linkTweet thisAlerts:
@anjanakumari888135Sep 18.2018 — Good Forum! You can share accounting outsourcing related problems to experts when you communicate with the professional’s team. At any time, you can get quality services from them via Bookkeeping toll-free number +38-0443-577-6 47/ +38-0967-478-575. For more services, you can click on the link: -https://accounting-outsourcing.com.ua/accounting-services-in-ukraine
Copy linkTweet thisAlerts:
@rootSep 18.2018 — mailto: is only compatible with systems that utilize it, if you want to allow users to decide on if they want the email address or to click a mail to option, you are not causing people headaches wrestling with software that is not set up like mine, I don't and have no need for email on my PC, its on the IMAP and no need unless I need it to have it on my machine, so mailto: being 20 years out of date, is a pointless exercise.

If you want to do this better, then yes, a contact form where you offer your server to contact you with their details...
Copy linkTweet thisAlerts:
@Scrif2016authorSep 18.2018 — I just want the 'SUBMIT' button on the contact form from this website http://pcnetguard.com/test9/ to send an email to the destination email address I choose. The destination email address will never change.
Copy linkTweet thisAlerts:
@NogDogSep 18.2018 — How does your web site run on the server. Is it PHP, NodeJS, Ruby, Java, etc.??? Depending on what you use, you'll want to create a file in that language/framework on the server that your form action will point to, and it will process/validate the form data and use relevant functions/libraries to actually send the email.
Copy linkTweet thisAlerts:
@Scrif2016authorSep 18.2018 — The site is hosted at Webhostingpad.com - I'm sure they run any/all of PHP, NodeJS, Ruby, Java, etc.

Let me take a step back. I have a business website. There is a section called 'Contact' which has a form that customers can fill out with their Name, Email, and a little blurb about what they are inquiring about and then hit the SUBMIT button.

When they hit 'SUBMIT' I want an email, with all of the info they entered, to go to a specific email address that will likely never change. There is currently NO CODE applied to the SUBMIT button.

What is the best way to achieve this?

Copy linkTweet thisAlerts:
@NogDogSep 19.2018 — IMO, the best way is basically what I said above: the form should point to a script on the web server that takes the form input and sticks it into an email, which is sent to the desired address by the web server. The nitty-gritty details depend on what server-side language/framework you choose to use, whether you want to use a 3rd-party library or framework to handle some of the details, etc. For instance, PHP has a built-in mail() function, which may be all you need if you use PHP. That being said, I tend to prefer to use the PHPMailer library to make sure a lot of the boring details of sending an email are done correctly, plus it makes it easier to use SMTP if, for instance, you want/need to leverage an email account on another server (e.g. your gmail account, perhaps) to send it.

Just to scratch the surface of "simply" using the PHP mail() function: http://php.net/manual/en/function.mail.php
Copy linkTweet thisAlerts:
@Yucca195Sep 19.2018 — If you like to play some games, for example Maplestory M, Fortnite, FIFA 19 ....

You can't miss [url=https://www.mmoah.com/]mmoah[/url] , where you will buy the cheapest products and enjoy the best service, you will enjoy a lot of discounts every holiday The discount amount is also different, of course, old customers will have extra discounts! At the same time, if you need to trade, we will have a professional team to serve you, you don't have to worry about security. This is guaranteed.

Finally, join https://www.mmoah.com/ now! A huge discount is waiting for you!
Copy linkTweet thisAlerts:
@rootSep 19.2018 — > @Scrif2016#1596000 ... I have a business website. There is a section called 'Contact' which has a form that customers can fill out with their Name, Email, and a little blurb about what they are inquiring about and then hit the SUBMIT button.

Very do-able in the manner in which I described, but you do need to like you suggest...
> @Scrif2016#1596000 Let me take a step back.

and if you have them land on your page for contacting you, then you will need to have a field for inputting their details for contact, like email, telephone, fax, mobile and the preferred mode of contact and a text area for them to type their comment to you and finally, some sort of captcha would be very advisable before being able to click the submit button.


Your back end script will need to then (advisable and as an encrypted database) store the transaction in a database and then email a copy to you.

The server you have should be configured to only send emails if that email account exists, so that part of the process is as simple as checking with the hosting service you use what their protocol is for web email contact forms and if they require additional scripting, like my web host has to have the email address and a cgi script run prior to sending, if it finds out something is not right, the email is simply dropped.

So email problems from contact forms can be as simple as the web hosting company.

As for the answer, there are plenty of web mailer contact form examples on this site, other sites and is a subject done to death but one common factor in all cases, no security checks.

You need to learn the vulnerabilities that can lead to your server being hacked from such forms.

Ultimately, you need to be white-listing inputs and sanitising in to a safe set of variables as well as that, checks to ensure that the incoming data is the result of a web contact form that your server issued and on the HTML side of things, use HTML5 inputs, more robust.
×

Success!

Help @Scrif2016 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...