Jump to content

Sooooooo I'm making a website for my uncle.

 

I have this form at the end that I want to have send all the information inputed to an email. Not open up an email application on the user's computer, but directly send it from the website.

 

I am VERY new to this stuff. I just thought it would be fun to learn html and dreamweaver, and so far it's been well. So I have gone through the internet, but I haven't found code that has been useful to me.

 

Here is the code that I have so far:

Spoiler

<section class="formsection">
  <h3 class="letstalk"> Let's talk.</h3>
  <h4 class="formdesc">Want to have us at your next event? Contact below!</h4>
<form class="emailForm" name="Email Form"
    method="post" action="send_form_email.php" enctype="text/plain">
<input name="first" type="first" required class="formDec" id="first" placeholder="First*">
<input name="last" type="last" required class="formDec" id="last" placeholder="Last*">
<input name="email" type="email" required class="formDec" id="email" placeholder="Email*" />
<input name="subject" type="subject" required class="formDec" id="subject" placeholder="Event Type (Wedding, party, etc.)">
<input name="message" type="message" required class="formDec messageForm" id="message" placeholder="Message">
<input type="submit" class="submitForm" id="submit" value="Submit">
</form>
</section>

 

I was messing with php, but couldn't figure it out. That's why it says send_form_email.php under action.

Link to comment
https://linustechtips.com/topic/585968-dreamweaver-help/
Share on other sites

Link to post
Share on other sites

The php e-mail code looks like this:

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

so you'll want something like

<?php
$to = $_POST["email"];
$subject = 'CHANGEME';
$message = 'CHANGEME';
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com\r\nX-Mailer: PHP/".phpversion();

mail($to, $subject, $message, $headers);
?>

You know, use your best judgement and whatnot. Change the e-mail addresses to whatever valid e-mail you want, from the same domain.

Link to comment
https://linustechtips.com/topic/585968-dreamweaver-help/#findComment-7637637
Share on other sites

Link to post
Share on other sites

1 minute ago, r3bify said:

The php e-mail code looks like this:


bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

so you'll want something like


<?php
$to = $_POST["email"];
$subject = 'CHANGEME';
$message = 'CHANGEME';
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com\r\nX-Mailer: PHP/".phpversion();

mail($to, $subject, $message, $headers);
?>

You know, use your best judgement and whatnot. Change the e-mail addresses to whatever valid e-mail you want, from the same domain.

So I create a new php file with the php code, where do I put the php e-mail code?

Link to comment
https://linustechtips.com/topic/585968-dreamweaver-help/#findComment-7637643
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×