skorski
Posts: 1
|
Posted: 01/02/2006, 4:55 AM |
|
I sent this email to the CCS help desk, but maybe someone from the forum can help me instead.
I add the follwing coding on the On validate of my record security.
if (errors.Count == 0){
System.Web.Mail.MailMessage message=new System.Web.Mail.MailMessage();
message.From = "info@skorskiwebdesign.com";
message.To = securityemail.Text;
message.Subject = "test";
message.Body = "test";
message.BodyFormat = System.Web.Mail.MailFormat.Text;
System.Web.Mail.SmtpMail.SmtpServer = "mail.itdev.ca";
System.Web.Mail.SmtpMail.Send(message);
}
I then try and publish my site and I get the following error:
Error:c:\Documents and Settings\Owner\Local Settings\Temp\~rentbyuwebsite\components\registrationformDataProvider.cs(371,22): error CS0246: The type or namespace name 'securityemail' could not be found (are you missing a using directive or an assembly reference?)
I know there is a field called email. If I add the same email code without the If statement on the "On Click" of my "Add button it works fine". I notice when I add code to the onclick coding it goes into the registrationform.aspx.cs, but when I add it to the On Validate it goes into the "RegistratonformDataProvider.cs".
All I want to do is send an email message after all fields have been validated. Having the coding on the "On Click" means an email message is sent every time even if there is validation errors.
Is there a better place to be putting this coding or am I doing something wrong with the coding I have now?
Thanks for all you help.
_________________
Mark Skorski
Skorski Web Design
www.skorskiwebdesign.com
info@skorskiwebdesign.com |
|
|
|