Making an Email Form Send Email

2020-04-18 05:13发布

问题:

I have the following code for an email form from an HTML template. I'd like to make it send email, as the moment I think it doesn't and I need to add some javascript to process the form. Any tips on how to do that for this form?

Thank you!

<!-- Email -->
<article id="email" class="panel">
    <header>

<h2>Email Me</h2>

    </header>
    <form action="#" method="post">
        <div class="5grid">
            <div class="row">
                <div class="6u">
                    <input type="text" class="text" name="name" placeholder="Name" />
                </div>
                <div class="6u">
                    <input type="text" class="text" name="email" placeholder="Email" />
                </div>
            </div>
            <div class="row">
                <div class="12u">
                    <input type="text" class="text" name="subject" placeholder="Subject" />
                </div>
            </div>
            <div class="row">
                <div class="12u">
                    <textarea name="message" placeholder="Message"></textarea>
                </div>
            </div>
            <div class="row">
                <div class="12u">
                    <input type="submit" class="button" value="Send Message" />
                </div>
            </div>
        </div>
    </form>
</article>

回答1:

Javascript cannot send an email (unless it's calling a server-side method using AJAX). You need a server-side language (e.g. C#, php, ColdFusion, etc.).