I’m working on a project where I need to create a feedback form that sends emails to a specific Gmail account. Here’s what I’ve got so far:
<form runat="server">
<div>
<asp:TextBox ID="recipientEmail" runat="server" ReadOnly="True">[email protected]</asp:TextBox>
</div>
<div>
<asp:TextBox ID="userName" runat="server" placeholder="Your Name"></asp:TextBox>
<asp:RequiredFieldValidator ID="nameValidator" runat="server" ErrorMessage="Name is required" ControlToValidate="userName"></asp:RequiredFieldValidator>
</div>
<div>
<asp:TextBox ID="userEmail" runat="server" placeholder="Your Email"></asp:TextBox>
</div>
<div>
<asp:TextBox ID="userPhone" runat="server" placeholder="Your Phone"></asp:TextBox>
</div>
<div>
<asp:TextBox ID="userMessage" runat="server" TextMode="MultiLine" placeholder="Your Message"></asp:TextBox>
</div>
<div>
<asp:Button ID="submitButton" runat="server" Text="Submit" OnClick="submitButton_Click" />
</div>
<asp:Label ID="statusLabel" runat="server"></asp:Label>
</form>
I’m wondering how to set this up so the messages actually go to the specified Gmail account. Can I test this without hosting the site? Also, do I need to store the submitted data in a database, or is just sending the email enough? Thanks for any help!