Click here to Skip to main content
15,902,198 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Add keyword and description info to database Pin
Not Active18-Nov-07 13:27
mentorNot Active18-Nov-07 13:27 
QuestionSending email in ASP.NET 2.0 Pin
nickabradley18-Nov-07 5:18
nickabradley18-Nov-07 5:18 
AnswerRe: Sending email in ASP.NET 2.0 Pin
Christian Graus18-Nov-07 10:40
protectorChristian Graus18-Nov-07 10:40 
GeneralRe: Sending email in ASP.NET 2.0 Pin
nickabradley18-Nov-07 10:43
nickabradley18-Nov-07 10:43 
GeneralRe: Sending email in ASP.NET 2.0 Pin
Michael Sync18-Nov-07 15:09
Michael Sync18-Nov-07 15:09 
GeneralRe: Sending email in ASP.NET 2.0 Pin
nickabradley18-Nov-07 15:23
nickabradley18-Nov-07 15:23 
GeneralRe: Sending email in ASP.NET 2.0 Pin
Michael Sync18-Nov-07 15:36
Michael Sync18-Nov-07 15:36 
GeneralRe: Sending email in ASP.NET 2.0 Pin
nickabradley18-Nov-07 16:07
nickabradley18-Nov-07 16:07 
OnSuccess event and OnFailure event were included in the example file that I’m using to try and make work.

Below is a copy of two of the files that are part of my feedback form:
Something’s wrong I just don’t know what…

Is there a way I can send you a zip file with every thing so maybe you can see what’s going on here?



--- feedback.aspx ---

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="feedback.aspx.cs" Inherits="_Default" %>
<%@ Register TagName="Captcha" TagPrefix="Controls" Src="~/Control/Captcha.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Burning Issues</title>
</head>
<body><form id="form1" runat="server">
<br />

<table width="100%" border="0" cellpadding="10">
<tr>
<td width="22%"><div align="right">
Name:</div></td>
<td width="78%">
<asp:TextBox ID="name" runat="server" Width="475px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="name"
ErrorMessage="Please enter your Name">*</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td><div align="right">Email Address: </div></td>
<td>
<asp:TextBox ID="email" runat="server" Width="475px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="email"
ErrorMessage="Please enter your Email address">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="email"
ErrorMessage="Please enter a valid Email address (Bob@example.com)" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></td>
</tr>
<tr>
<td><div align="right">OA Lodge Name and Number:</div></td>
<td>
<asp:TextBox ID="lodge" runat="server" Width="475px"></asp:TextBox>
</td>
</tr>
<tr>
<td><div align="right">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="Status"
ErrorMessage="Please Slect your Status">*</asp:RequiredFieldValidator>Membership Status:</div></td>
<td><p>
&nbsp;<asp:RadioButtonList ID="Status" runat="server">
<asp:ListItem>Non Member</asp:ListItem>
<asp:ListItem>Ordeal</asp:ListItem>
<asp:ListItem>Brotherhood</asp:ListItem>
<asp:ListItem>Vigil</asp:ListItem>
</asp:RadioButtonList></p>
</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<p>Please leave us any questions or comments that you may have. In order for us to be able to reply via e-mail be sure we have you e-mail address above and please keep you questions or comments to fewer than 1000 characters.<asp:RequiredFieldValidator
ID="RequiredFieldValidator4" runat="server" ControlToValidate="Remarks" ErrorMessage="Please keep your Comments to 1000 chars or less">*</asp:RequiredFieldValidator></p>
<p>
&nbsp;<asp:TextBox ID="Remarks" runat="server" Height="100px" MaxLength="1000" TextMode="MultiLine"
Width="750px"></asp:TextBox></p>
</div></td>
</tr>
</table>
<p>&nbsp;</p>
<Controls:Captcha ID="captcha" Message="Please enter text shown below:" runat="server"
OnSuccess="OnSuccess" OnFailure="OnFailure" BackgroundColor="#ffffff" />
<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
&nbsp; &nbsp;

</form>

</body>
</html>

--- End of File ---




--- feedback.aspx.cs ---

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
SmtpClient smtpClient = new SmtpClient("mail.talligewi62.org");
MailMessage message = new MailMessage();

try
{
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("nickbradley@talligewi62.org");
message.Subject = "Talligewi 62 Website Feedback";
message.Bcc.Add(new MailAddress("winterbanquet@talligewi62.org"));
message.IsBodyHtml = false;
message.Body = lodge.Text; remarks.Text; Status.Text;
smtpClient.Send(message);

Response.Redirect("http://www.talligewi62.org");
}
catch (Exception ex)
{
}

captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}

--- End of File ---
GeneralRe: Sending email in ASP.NET 2.0 Pin
Michael Sync18-Nov-07 16:27
Michael Sync18-Nov-07 16:27 
GeneralRe: Sending email in ASP.NET 2.0 Pin
nickabradley18-Nov-07 16:33
nickabradley18-Nov-07 16:33 
GeneralRe: Sending email in ASP.NET 2.0 Pin
Christian Graus18-Nov-07 17:59
protectorChristian Graus18-Nov-07 17:59 
GeneralRe: Sending email in ASP.NET 2.0 Pin
nickabradley19-Nov-07 15:48
nickabradley19-Nov-07 15:48 
GeneralRe: Sending email in ASP.NET 2.0 Pin
Michael Sync19-Nov-07 15:55
Michael Sync19-Nov-07 15:55 
GeneralRe: Sending email in ASP.NET 2.0 Pin
nickabradley19-Nov-07 16:12
nickabradley19-Nov-07 16:12 
QuestionProblem in sending e-mails [modified] Pin
qmzph18-Nov-07 5:13
qmzph18-Nov-07 5:13 
AnswerRe: Problem in sending e-mails Pin
DigiOz Multimedia18-Nov-07 5:56
DigiOz Multimedia18-Nov-07 5:56 
QuestionProblem uploading files Pin
Zoltan Aszalos18-Nov-07 4:30
Zoltan Aszalos18-Nov-07 4:30 
AnswerRe: Problem uploading files Pin
Hesham Amin18-Nov-07 12:21
Hesham Amin18-Nov-07 12:21 
GeneralRe: Problem uploading files Pin
Zoltan Aszalos18-Nov-07 20:34
Zoltan Aszalos18-Nov-07 20:34 
GeneralRe: Problem uploading files Pin
Hesham Amin21-Nov-07 10:44
Hesham Amin21-Nov-07 10:44 
QuestionSeparate Projects for BLL & DAL Pin
Montu7618-Nov-07 2:37
Montu7618-Nov-07 2:37 
AnswerRe: Separate Projects for BLL & DAL Pin
Colin Angus Mackay18-Nov-07 2:55
Colin Angus Mackay18-Nov-07 2:55 
AnswerRe: Separate Projects for BLL & DAL Pin
pmarfleet18-Nov-07 8:01
pmarfleet18-Nov-07 8:01 
Questionget list of user Pin
ptvce17-Nov-07 20:15
ptvce17-Nov-07 20:15 
QuestionNetwork Traffic and Activity monitoring via ASP.Net Pin
MeNew17-Nov-07 17:12
MeNew17-Nov-07 17:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.