Home

 

The following is the code for sending an email.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

MailMessage message=new MailMessage();

message.To=txtTo.Text;

message.From="[email protected]";

message.Subject=TxtSub.Text;

message.Body=TxtBody.Text;

SmtpMail.SmtpServer="smtp.mail.yahoo.com";

SmtpMail.Send(message);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

A typical global.asax file might look like

protected void Application_Start(Object sender, EventArgs e)

{

Application["services"]=new MyProject.Services();

 

}

 

protected void Session_Start(Object sender, EventArgs e)

{

Session["UserName"]="";

Session["productid"]="";

Session["Cart"]="";

Session["buyerproductid"]="";

}

protected void Application_BeginRequest(Object sender, EventArgs e)

{

}

protected void Application_EndRequest(Object sender, EventArgs e)

{

}

protected void Application_AuthenticateRequest(Object sender, EventArgs e)

{

}

protected void Application_Error(Object sender, EventArgs e)

{

}

protected void Session_End(Object sender, EventArgs e)

{

}

protected void Application_End(Object sender, EventArgs e)

{

}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

Hosted by www.Geocities.ws

1