Webpage Email form

Soldato
Joined
25 Oct 2009
Posts
6,685
Location
Caerphilly
A very simple concept;
I want a form that people have to fill out and click Submit and it emails me the forms details.

I can get this setup working perfectly but it uses a HTML email form that needs permission from the the installed email client to send the email.. i don't want this as i dont want it relying on the machine having a email client installed.

What i want is for it do it all itself... I have exchange servers I can use but don't know how to accomplish it... JS, PHP maybe?

Any help appreciated... thanks :)
 
Thanks guys.
Being quite limited to what I can do with the webpage I've been given (and not knowing enough about sql databases) it's really not an option to do it that way unfortunately. unless there's another option?

I've had a look at that link thanks and shall have a play with it later today.
 
I can get this setup working perfectly but it uses a HTML email form that needs permission from the the installed email client to send the email..

rhysduck,

Maybe I haven't fully understood the problem, but on the html form, you can set the 'form action' as the link to a processing page on your site, where the submit button will send the form details to this page, this page will collect the form information, process it into an E-mail, and send you an E-mail through your website?
 
rhysduck,

Maybe I haven't fully understood the problem, but on the html form, you can set the 'form action' as the link to a processing page on your site, where the submit button will send the form details to this page, this page will collect the form information, process it into an E-mail, and send you an E-mail through your website?

This. Unless I'm understanding it wrong as well, surely you can just set the action for your form as, say, a PHP script that takes the data from the form and sends it to your email address?
 
Maybe I haven't fully understood the problem, but on the html form, you can set the 'form action' as the link to a processing page on your site, where the submit button will send the form details to this page, this page will collect the form information, process it into an E-mail, and send you an E-mail through your website?
ok, the problem is that I have created a html email form that emails me the forms details BUT requires the computer having a mail client installed and sends the information through that. I don't want the user to be able to see any of this and after clicking SUBMIT everything is done in the background. Unfortunately my PHP skills are... zero. I know it can be achieved but I don't know how.
My form action is:
Code:
<form action="mailto:emailaddress" method="post"  enctype="text/plain">
but it does the above and not in the background.

This. Unless I'm understanding it wrong as well, surely you can just set the action for your form as, say, a PHP script that takes the data from the form and sends it to your email address?
If PHP can accomplish what I want I may need to dig out some books on PHP. Thanks.

Hope I don't sound to confusing
 
It's relatively simple, look at this mini mocked-up example:

Say you have this code for your Contact form in your HTML:

Code:
<!-- Other HTML -->

<form method="post" action="message_engine.php">

    <label for="Name">Name:</label>
    <input type="text" name="Name" id="Name" />

    <label for="Email">Email:</label>
    <input type="text" name="Email" id="Email" />

    <label for ="Message">Message:</label>
    <input type="text" name="Message" id="Message" />

</form>

<!-- Rest Of HTML -->

Notice the action="message_engine.php" in the contact form. Then you would have this as the PHP script it called:

Code:
//message_engine.php 
	
$EmailTo = "[email protected]";
$Subject = "Message";
					
$Message= Trim($_POST['Message']);					
$Name = Trim($_POST['Name']); 				
$Email = Trim($_POST['Email']); 
					
mail($EmailTo, $Subject, $Message, "From: <$Email>");

Which, if everything is syntactically correct, it would email you everything. Obviously you can add other bells and whistles to the PHP but I'm fairly sure that'd do what you want.

If my example doesn't help, there's probably quite a few tutorials on the internet.

Edit: I've quickly mocked up the code so I'm sorry if it's not 100% correct/secure/efficient or working for that matter. If it's confused you further then I am sorry...
 
Last edited:
What dk345 says is along the lines of what I have just spent 10 minutes typing, only to notice I was beaten to it! :mad::p

That solution should work fine having very quickly looked over it.
 
Back
Top Bottom