As a systems manager, no doubt one had to handle complaints and feedbacks from customers.

A nifty utility I've developed while working in a company using server technology such as Cold Fusion, is to allow customers to provide complaints and feedbacks using a web form.

I've ported the concept of providing customer feedback into ASP.NET and Delphi, and the code below is a complete application that allows you to get feedback from customers with such a form.

<%@ Page Language="Delphi" debug="true" ContentType="text/html" ResponseEncoding="utf-8" %>

<%@ Page Language="Delphi" debug="true" ContentType="text/html" ResponseEncoding="utf-8" %>
<%@Import Namespace="System.Web.Mail"%>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="Delphi" runat="server">
procedure SendFeedback(Sender: System.Object; E: EventArgs);
  mail: MailMessage;
   mail := MailMessage.Create;
   mail.&To := 'Your Name <>';
   mail.From := From.Text;
   mail.Subject := 'Feedback';
   mail.Body := Message.Text;

   mail.Headers.Add('X-Organization', 'Your Organization');

// SMTP authentication - Remove if not needed
   mail.Fields[''] := 'mysmtpserver';
   mail.Fields[''] := 'myusername'; //set your username here
   mail.Fields[''] := 'mypassword'; //set your password here

   SmtpMail.SmtpServer :=  'mysmtpserver';  
   Message.Text := '';
    on E: Exception do
      Message.Text := 'Your message was not delivered due to an error. Please retry at a later time.';

<form runat="server"><strong>From:</strong> <asp:textbox ID="From" ReadOnly="false" runat="server" TextMode="SingleLine" /><br>
<asp:textbox Columns="80" ID="Message" ReadOnly="false" Rows="10" runat="server" TextMode="MultiLine" /><br>
  <asp:button runat="server" Text="Send Feedback" OnClick="SendFeedback" runat="server"/>