CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Unable to send email on Sucesfull validate

Print topic Send  topic

Author Message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.