This question has been archived.

I have an html contact form on my website. How can visitors email me from my contact form?

December 28, 2015 2.6k views
Email Getting Started Ubuntu

This code from W3C schools for an html form does not address the backend server side code needed to actually send an email.

Please tell me the fastest, easiest (non php) way of triggering an email to my address.


<!DOCTYPE html>

<h2>Send e-mail to</h2>

<form action="" method="post" enctype="text/plain">
<input type="text" name="name" value="your name"><br>
<input type="text" name="mail" value="your email"><br>
<input type="text" name="comment" value="your comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">


  • When you typed in sudo sendmailconfig, you should have been prompted to configure sendmail.

    For reference, the files that are updated during configuration are located at the following (in case you want to update them manually):


    You can test sendmail to see if it is properly configured and setup by typing the following into the command line:

    $ echo "My test email being sent from sendmail" | /usr/sbin/sendmail

  • What about Sendmail and Sendgrid? I found this answer on StackOverflow:

    Change to your mail config directory:
    cd /etc/mail

    Make a auth subdirectory
    mkdir auth
    chmod 700 auth #maybe not, because I cannot apply cmd "cd auth" if I do so.

    Create a file with your auth information to the smtp server
    cd auth
    touch client-info

    In the file, put the following, matching up to your smtp server: "U:root" "I:user" "P:password"

    Generate the Authentication database, make both files readable only by root
    makemap hash client-info < client-info
    chmod 600 client-info
    cd ..

    Add the following lines to Make sure you update your smtp server The first single quote for each string should be changed to a backtick (`) like this:
    FEATURE(authinfo',hash /etc/mail/auth/client-info')dnl

    sudo sendmailconfig

  • The latest response from SendGrid:

    *Hi there,

    The easiest way to send emails through your form is with the web API call.

    When somebody fills in the form, and clicks on send, you will get the data from the form, add is as content to the email, and then send it to your email address. Of course all this needs to be done programmatically.

    In case you need further assistance regarding this matter, please feel free to contact the SendGrid Support Team at any time.
    We all wish you a great day!

    Best regards,
    Victor A*

Be the first one to answer this question.