Click here to Skip to main content
15,889,858 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public partial class pgEmail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSend_Click(object sender, EventArgs e)
    {
        try
        {
            //create object clsBusinessLayer class and call sendMail method
            clsBusinessLayer sendObj = new clsBusinessLayer();
            sendObj.SendEmail(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text);

            //set the successful mail sent message to the status label
            lblStatus.Text = "The message was sent to: " + txtTo.Text;

        }
        catch (Exception ex)
        {
            // set the not successful mail sent message to the status label
            lblStatus.Text = "An error has occurred while trying to send this message, " + ex.Message;
        }
    }
}
Posted
Updated 17-Mar-13 18:39pm
v2
Comments
Hari Om Prakash Sharma 18-Mar-13 0:41am    
What is the error you are getting during compilation of this code?
Juan Victoriano 18-Mar-13 0:44am    
This is the error I get when I run my app:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'clsBusinessLayer' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



Line 23: {
Line 24: //create object clsBusinessLayer class and call sendMail method
Line 25: clsBusinessLayer sendObj = new clsBusinessLayer();
Line 26: sendObj.SendEmail(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text);
Line 27:

not sure how to fix it.
raju melveetilpurayil 18-Mar-13 0:41am    
Please update your question with proper description like what you tried and what error you got...etc.
Juan Victoriano 18-Mar-13 0:44am    
This is the error I get when I run my app:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'clsBusinessLayer' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



Line 23: {
Line 24: //create object clsBusinessLayer class and call sendMail method
Line 25: clsBusinessLayer sendObj = new clsBusinessLayer();
Line 26: sendObj.SendEmail(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text);
Line 27:

not sure how to fix it. The error is line 25.
raju melveetilpurayil 18-Mar-13 0:48am    
Read the Compiler Error Message:
The type or namespace name 'clsBusinessLayer' could not be found (are you missing a using directive or an assembly reference?)

1 solution

Solved by the OP - answered only to remove from unanswered list.
 
Share this answer
 
Comments
Deenuji 18-Mar-13 4:00am    
sir i have one doubt...shall i ask???
OriginalGriff 18-Mar-13 4:07am    
Hijacking a thread is considered rude, so I would suggest that you open a new question and ask it! :laugh:
Deenuji 18-Mar-13 4:08am    
sir i posted that question....that question link is
http://www.codeproject.com/Questions/563405/Shuffleplusonepluscolumnplusvalueplusinplussqlplus

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900