-2

Where does my send to email go on this form?

<!--Start Contact form -->                                                      
<form action="email/" method="post" name="enq" target="_blank" onsubmit="return validation();">
  <fieldset>

    <input type="text" name="name" id="name" value=""  class="input-block-level" placeholder="Name" />
    <input type="text" name="email" id="email" value="" class="input-block-level" placeholder="Email" />
    <textarea rows="11" name="message" id="message" class="input-block-level" placeholder="Comments"></textarea>
    <div class="actions">
    <input type="submit" value="Send Your Message" name="submit" id="submitButton" class="btn btn-info pull-right" title="Click here to submit your message!" />
    </div>

    </fieldset>
</form>                  
            <!--End Contact form -->
ainks
  • 9
  • 1

1 Answers1

2

You can use the PHP built-in mail() function for sending emails to one or more recipients dynamically from your PHP app either in a plain-text form or formatted HTML.

The basic syntax of the mail() function is as follows;

mail(to, subject, message, headers, parameters)

Easiest way to send emails from php

<?php
    $to = 'xyz@somedomain.com';
    $subject = 'This is subject';
    $message = 'This is email message'; 
    $from = 'sendermailadd@email.com';

    // Sending email
    if(mail($to, $subject, $message)){
        echo 'Your mail has been sent successfully.';
    } else{
        echo 'Unable to send email. Please try again.';
    }
?>

for further explained details please refer tutorialspoint.com


Please note that the PHP mail() function is a part of the PHP core but you need to set up a mail server on your machine to make it really work.

How to configure XAMPP to send mails from localhost Read From here

Omal Perera
  • 2,971
  • 3
  • 21
  • 26