Click here to Skip to main content
15,909,652 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Please help me as soon as possible. I want the source code too. Please
Posted
Updated 27-May-12 17:43pm
v2
Comments
Prasad_Kulkarni 27-May-12 23:45pm    
On web, using all CAPITALS is considered as shouting, and using all small letters considered as childish use proper capitalization always.
Manoj K Bhoir 28-May-12 1:54am    
My 5! to Prasad!
Prasad_Kulkarni 28-May-12 3:05am    
Thanks Manoj!
Sandeep Mewara 28-May-12 5:54am    
Anything else with Code?

1 solution

Hope this helps u.This is my registration form code.Pls change as per your needs.Change this to vb


var
protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            string userinfo;
            string noDetails = "-Not Provided-";
            string email;
            SmtpClient smtpClient = new SmtpClient();
            MailMessage message = new MailMessage();
            MailAddress fromAddress = new MailAddress(txtEmail.Text);
            //Client webmail
            smtpClient.Host = "smtp.1and1.com";
            smtpClient.Port = 25;
            smtpClient.Credentials = new NetworkCredential("username", "password");
            smtpClient.EnableSsl = true;
            message.From = fromAddress;
            //PHW email-id
            message.To.Add("username ");

           
            message.Subject = "Registration Requisition";
            message.IsBodyHtml = true;

            userinfo = "<b>" + "<div>" + "<u>" + "School Information" + "</u>" + "</div>" + "</b>" + "<br>" +
                        "<table border='1' bordercolor='#BD213A' bordercolordark='#BD213A' bordercolorlight='#0092DD'>" +

                        "<tr>" +
                        "<td style='width: 131px'>" +
                            "School Name" + "</td>" +
                        "<td style=width: 250px>" +
                            txtFirstName.Text  + " </td>" +
                        "</tr>" +

                        "<tr>" +
                        "<td style='width: 131px'>" +
                            "First Name " + "</td>" +
                        "<td style=width: 250px>" +
                            txtLastName.Text  + " </td>" +
                        "</tr>" +

                        "<tr>" +
                        "<td style='width: 131px'>" +
                            "Last Name " + "</td>" +
                        "<td style=width: 250px>" +
                            TextBox1 .Text + " </td>" +
                        "</tr>" +

                       "<tr>" +
                        "<td style='width: 131px' >" +
                            "City" + "</td>" +
                        "<td style='width: 250px'>" +
                            txtCity.Text + "</td>" +
                        "</tr>" +

                         "<tr>" +
                        "<td style='width: 131px' >" +
                            "Country" + "</td>" +
                        "<td style='width: 250px'>" +
                            dd1Country.SelectedItem.Text + "</td>" +
                        "</tr>" +
                         "<tr>" +
                        "<td style='width: 131px' >" +
                            "Phone" + "</td>" +
                        "<td style='width: 250px'>" +
                            txtPhone.Text + "</td>" +
                        "</tr>" +
                         "<tr>" +
                        "<td style='width: 131px' >" +
                            "Zipcode" + "</td>" +
                        "<td style='width: 250px'>" +
                            txtZip.Text + "</td>" +
                        "</tr>" +
                        "<tr>" +
                        "<td style='width: 131px' >" +
                            "Email" + "</td>" +
                        "<td style='width: 250px'>" +
                            txtEmail.Text + "</td>" +
                        "</tr>" +
                        "</table>";

            message.Body = userinfo;
            message.Body = string.Concat(userinfo);
            smtpClient.Send(message);
            beforereg.Visible = false;
            Confirmpnl.Visible = true;
            this.Response.AppendHeader("Refresh", @"8;url='Default.aspx'");
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

    private string StripHTML(string source)
    {
        try
        {
            string result;
            // Replaces all line breaks with the <BR> tag
            result = source.Replace("\r\n", "<br>");
            return result;
        }
        catch
        {
            Console.WriteLine("Error");
            return source;
        }
    }
 
Share this answer
 
v3

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