| | |
asp.net helpdesk form
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2006
Posts: 26
Reputation:
Solved Threads: 0
Hi All,
I'm creating a helpdesk style feedback form that saves to an xml file so that we can track past requests. The XML part works fine, but the problem I'm having is getting the form to email off details to alert us when a new request is made. The form appears to be working (in that I'm not getting any error message, but the emails aren't coming through.
The form code is:
and the C# code behind code is:
Forgive the lack of naming conventions! I realised AFTER I hacked apart an old html form from my early web days.
NB. It may or may not also be worth noting that the web server and the mail server are the same.
I had a basic test script that worked, yet this one won't, so any ideas would be great!!
Thanks in advance.
Luke
ForestTech
I'm creating a helpdesk style feedback form that saves to an xml file so that we can track past requests. The XML part works fine, but the problem I'm having is getting the form to email off details to alert us when a new request is made. The form appears to be working (in that I'm not getting any error message, but the emails aren't coming through.
The form code is:
ASP.NET Syntax (Toggle Plain Text)
<table cellpadding="3" cellspacing="3" align="center"> <tr> <td bgcolor="#F0F0F0" colspan="2" align="center"> <font face="Arial, Helvetica, sans-serif" size="2"><b>Please Fill Out The Form Below</b></font> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Name:*</font> </td> <td> <ASP:Textbox id="name" size="64" runat="server"/> </td> <td> <asp:RequiredFieldValidator id="nameRequired" runat="server" ControlToValidate="name" ErrorMessage="You must enter a value into Name" Display="dynamic">Enter name </asp:RequiredFieldValidator> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Company:*</font> </td> <td> <ASP:Textbox id="company" size="64" runat="server" /> </td> <td> <asp:RequiredFieldValidator id="companyRequired" runat="server" ControlToValidate="company" ErrorMessage="You must enter a value into Company" Display="dynamic">Enter company </asp:RequiredFieldValidator> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Phone(B/H):</font> </td> <td> <ASP:Textbox id="busphone" size="64" runat="server" /> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Phone(A/H):</font> </td> <td> <ASP:Textbox id="ahphone" size="64" runat="server" /> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Mobile:</font> </td> <td> <ASP:Textbox id="mobile" size="64" runat="server" /> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Email:</font> </td> <td> <ASP:Textbox id="txtEmail" size="64" runat="server" /> </td> </tr> <tr> <td> <font face="Arial, Helvetica, sans-serif" size="2">Comment:*</font> </td> <td> <ASP:Textbox id="comment" TextMode="Multiline" columns="50" rows="10" wrap="true" runat="server" /> </td> <td> <asp:RequiredFieldValidator id="commentRequired" runat="server" ControlToValidate="comment" ErrorMessage="You must enter a value into textbox1" Display="dynamic">Enter comment </asp:RequiredFieldValidator> </td> </tr> <tr> <td colspan="2" bgcolor="#F0F0F0" colspan="2" align="center"> <ASP:Button id="submit" runat="server" Text="Submit" OnClick="Save_Comment"/> </td> </tr> </table>
ASP.NET Syntax (Toggle Plain Text)
public partial class _Default : System.Web.UI.Page { public TextBox comment; public TextBox txtEmail; protected void Save_Comment(object sender, EventArgs e) { try { MailMessage message = new MailMessage(txtEmail.Text, "helpdesk@mailserver.com", "Helpdesk Request", comment.Text); SmtpClient txtEmailClient = new SmtpClient("ns1.mailserver.com"); System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("helpdesk@mailserver.com", "password"); txtEmailClient.UseDefaultCredentials = false; txtEmailClient.Credentials = SMTPUserInfo; txtEmailClient.Send(message); } catch (Exception ex) { } } }
NB. It may or may not also be worth noting that the web server and the mail server are the same.
I had a basic test script that worked, yet this one won't, so any ideas would be great!!
Thanks in advance.
Luke
ForestTech
Last edited by ForestTech; Sep 2nd, 2007 at 10:32 pm. Reason: Hosting Note added
![]() |
Similar Threads
- Simple ASP.Net Login Page using C# (C#)
- Call external program from ASP.NET (ASP.NET)
- ASP.NET and Mozilla - Issues! (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- ASP.NET / C# Dynamic Control (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: External connection
- Next Thread: draft print in asp.net 2.0
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





