-1

I'm designing a simple web-app so that the company I work for can receive referrals from different businesses. I made most of the front page but I need some help with sending the info from the form to a specific email address when the submit button is pressed. I looked at some tutorials online but for some reason I'm not understanding it still. Any help would be appreciated.

This is what I have so far...

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style>
        body {
            background-color: #e20404;
            color: #FFFFFF;
            font-family: Arial, sans-serif;
        }
        h1 {
            font-size: 36px;
            font-weight: bold;
            margin: 0;
        }
        .hero {
            background-image: url("phone-repair.jpg");
            background-size: cover;
            background-position: center;
            height: 500px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
        }
        .hero h2 {
            font-size: 48px;
            margin: 0;
            text-shadow: 2px 2px #000000;
        }
        .hero p {
            font-size: 24px;
            margin: 20px 0 0 0;
            text-shadow: 2px 2px #000000;
        }
    </style>
</head>
<body>
    <br>
    <br>
    <header>
        <h1></h1>
    </header>
    <br>
    <br>
    <section class="hero">
        <h1><img src="https://scontent-dfw5-2.xx.fbcdn.net/v/t39.30808-6/310105465_435474288684271_2112950804519462739_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=09cbfe&_nc_ohc=vn1mBIuA8v8AX-c7mRv&tn=4IOIOF7YavKFUIEN&_nc_ht=scontent-dfw5-2.xx&oh=00_AfBHKCcI06i24ne9jd-Fztb2JIbgCBqb54G5S5HIRAA6bw&oe=63F30F2D" alt="image" height=500px width=400px><br>
        <h2>Phone Doctors Referral Center</h2>
        <form>
            <br>
            <label for="efname">Employee First Name:</label><br>
            <input type="text" id="efname" name="efname" style="margin-top: 5px;"><br>
            <br>
            <label for="elname">Employee Last Name:</label><br>
            <input type="text" id="elname" name="elname" style="margin-top: 5px;"><br>
            <br>
            <label for="elocation">Store Location:</label><br>
            <input type="text" id="elocation" name="elocation" style="margin-top: 5px;"><br>
            <br>
            <br>
            <br>
            <label for="cfname">Customer's Full Name:</label><br>
            <input type="text" id="cfname" name="cfname"><br>
            <br>
            <label for="cphone">Customer's # or email:</label><br>
            <input type="text" id="cphone" name="cphone"><br>
            <br>
            <p>Is the phone an iOS or Android device?</p>
            <form>
                <select name="dropdown">
                    <option value="Android" selected>Android</option>
                    <option value="iOS" selected>iOS</option>
                </select>
            <br>
            <br>
            <label for="mphone">Model of Phone:</label><br>
            <input type="text" id="mphone" name="mphone"><br>
            <br>
            <label for="wissue">What is the issue?</label><br>
            <input type="text" id="wissue" name="wissue"><br>
            <br>
            <label for="anotes">Anything else we should know?</label><br>
            <input type="text" id="anotes" name="anotes"><br>
            <br>
            <br>
            <input type="submit" value="Submit">
            </form>


            </form>
            <br>
            
          </form>
    </section>
    <section>
        <!-- Add more content here -->
    </section>
    <footer>
        <!-- Add footer content here -->
    </footer>
</body>
</html>
Razaroth
  • 1
  • 1
  • 2
    Welcome to Stack Overflow! This question is too broad to really get help here. Here are a couple links (I have no affiliation with them) to get you closer. You will need to use some sort of server side language (PHP or similar) to actually send the email. https://html.form.guide/email-form/php-form-to-email/ or https://stackoverflow.com/questions/5335273/how-can-i-send-an-email-using-php or https://www.lcn.com/support/articles/how-to-create-an-email-form-with-php/ – disinfor Feb 17 '23 at 18:29

1 Answers1

-1

I recommand to use the action="mailto: field of your form. That way you should be able to send the form's data to a specific email. You could also use enctype=text/plain in order to have an easier form to read.

Here's an example to help you understand: <form action="mailto:someone@.com" enctype="text/plain">

This site covers the subject in more details, if you want more information: https://html.form.guide/email-form/email-form-mailto/

I hope this will help you.

Nantodou
  • 44
  • 1