top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to Send user Confirmation email after Registration in ASP.Net?

0 votes
How to Send user Confirmation email after Registration in ASP.Net?
posted Apr 27, 2017 by Jdk

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

You can use the below code to send confirmation email to user.

    // Send Email to user email address
    public void Send_Account_Activation_Link(string emailaddress, string act_code)
        MailMessage mm = new MailMessage("Your EMail ID", emailaddress);
        mm.Subject = "Account Activation";
        string body = "Hello " + txtusername.Text + ",";
        body += "

Please click the following link to activate your account
        body += "

<a style='background:#000000; color:#fafafa; padding:10px 100px 10px 100px; width:350px; text-decoration:none; font-weight:bold; font-size:20px;' href = '"+ Request.Url.AbsoluteUri.Replaceundefined"Registration.aspx", "Account_Activation.aspx?ActivationCode=" + act_code) + "'>Click here to activate your account.</a>";
        body += "

        mm.Body = body;
        mm.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient("", 587);
        smtp.Credentials = new System.Net.NetworkCredential("Your Email ID", "<your email="" password="">");
        smtp.EnableSsl = true;
answer May 3, 2017 by Shweta Singh
Similar Questions
+7 votes

How to create your own controls?
Basic steps will be helpful.

0 votes

When no MTA is installed, How to send an email with a cronjob? I have below entry in my cronjob? My /etc/cron.d/backup file looks like this.
15 11 * * * root /root/scripts/

Can I send this email via SMTP server?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.