---
title: "About Sending an Email after registration"  
description: "About Sending an Email after registration"  
author: "Anonymous User"  
published: 2011-02-17  
updated: 2011-02-17  
canonical: https://www.mindstick.com/forum/165/about-sending-an-email-after-registration  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# About Sending an Email after registration

Hi,\
I want a [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) to send an [email](https://www.mindstick.com/articles/12870/10-easy-ways-to-manage-your-business-email-inbox), to a [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) after registration. That email will contain some [images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support) and a [link](https://www.mindstick.com/articles/23633/link-builder) back [url](https://www.mindstick.com/forum/436/url-redirection) for an [account](https://www.mindstick.com/articles/33699/how-tech-is-disrupting-the-accounting-world) confirmation.\
Please provide me [sample](https://www.mindstick.com/news/2174/mars-mission-by-nasa-prepares-for-tests) of code.\
\
Thanks,\
Andrew\

## Replies

### Reply by Uttam Misra

check this blog\
\
http://www.mindstick.com/Blog/42/How%20To%20Send%20Email%20Using%20System%20Web%20Mail\
\
\

### Reply by Uttam Misra

check this code...I hope this will help you..\

```
using System.Web.Mail;try            {                string smtpServer = "relay-hosting.secureserver.net";                string userName = "contact@yourdomain.com";                int cdoBasic = 1;                int cdoSendUsingPort = 2;                MailMessage msg = new MailMessage();                if (userName.Length > 0)                {                    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer);                    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);                    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort);                    msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic);                    //msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName);                    // msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);                }                msg.To = "contact@yourdomain.com";                msg.From = "contact@yourdomain.com";                msg.BodyFormat = MailFormat.Html;                msg.Subject = txtSubject.Text;                           msg.Body = "Name: " + txtName.Text + "<br /><br />Company: " + txtCompany.Text + "<br /><br />Email: " + txtEmail.Text + "<br />" + txtDetails.Text;                SmtpMail.SmtpServer = smtpServer;                SmtpMail.Send(msg);                 msg.To = txtEmail.Text.Trim();                msg.From = "donotreply@yourdomain.com";                msg.BodyFormat = MailFormat.Html;                msg.Subject = txtSubject.Text;                msg.Body = @"Hi,<br/>                Thanks for contacting , we will review your information and try to get back to you ASAP.<br/>                Thanks;                 SmtpMail.SmtpServer = smtpServer;                SmtpMail.Send(msg);                ValidationSummary1.Visible = false;                lblStatus.Visible = true;                lblStatus.Text = "Message Sent Sucessfully.";             }            catch            {
```

\

cheers \

\


---

Original Source: https://www.mindstick.com/forum/165/about-sending-an-email-after-registration

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
