I am working with asp .net. I want to send an authentication code to user's email when he sign up. I'm using this code to send email. I'm adding a html file to send. How can I add the authentication code to this HTML file?

This is the code which I used to send the html file via Email. So how can I add a `string(authenticationCode)` to HTML file to send it to the user for authentication.

```
var fromAddress = new MailAddress("hamza230@gmail.com", "From Hamza");
        var toAddress = new MailAddress("usama90@gmail.com", "To Usama");
        const string fromPassword = "****";
        const string subject = "email";
        const string body = "hello world";

        var smtp = new SmtpClient
        {
            Host = "smtp.gmail.com",
            Port = 587,
            EnableSsl = true,
            DeliveryMethod = SmtpDeliveryMethod.Network,
            Credentials = new NetworkCredential(fromAddress.Address, fromPassword),
            Timeout = 20000
        };
        MailMessage message = new MailMessage(fromAddress, toAddress);
        message.Subject = subject;
        message.Body = body;
        message.BodyEncoding = Encoding.UTF8;

        String plainBody = "Title";

        AlternateView plainView = AlternateView.CreateAlternateViewFromString(plainBody, Encoding.UTF8, "text/plain");
        message.AlternateViews.Add(plainView);

        MailDefinition msg = new MailDefinition();
        msg.BodyFileName = "~/newsletter.html";

        msg.IsBodyHtml = true;
        msg.From = "usamaazam10@gmail.com";
        msg.Subject = "Subject";

        ListDictionary replacements = new ListDictionary();

        MailMessage msgHtml = msg.CreateMailMessage("usamaazam10@gmail.com", replacements, new LiteralControl());
        AlternateView htmlView = AlternateView.CreateAlternateViewFromString(msgHtml.Body, Encoding.UTF8, "text/html");

        LinkedResource logo = new LinkedResource(System.Web.HttpContext.Current.Server.MapPath("~/images/logo.jpg"), MediaTypeNames.Image.Jpeg);
        logo.ContentId = "logo";
        htmlView.LinkedResources.Add(logo);

        LinkedResource cover = new LinkedResource(System.Web.HttpContext.Current.Server.MapPath("~/images/cover.jpg"), MediaTypeNames.Image.Jpeg);
        cover.ContentId = "cover";
        htmlView.LinkedResources.Add(cover);

        message.AlternateViews.Add(htmlView);

        smtp.Send(message);

```
['https://Stackoverflow.com/questions/48661858', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
How about this:

If your service is based off of the *microsoft/dotnet* Docker image, create a new dockerfile based on the same image, and install the debugger, ssh and unzip.

```
FROM microsoft/dotnet

RUN apt-get update && apt-get -y install openssh-server unzip

RUN mkdir /var/run/sshd && chmod 0755 /var/run/sshd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin without-password/g' /etc/ssh/sshd_config
RUN sed -i 's/#StrictModes yes/StrictModes no/g' /etc/ssh/sshd_config

RUN service ssh restart

RUN mkdir /root/.vs-debugger && chmod 0755 /root/.vs-debugger
RUN curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v vs2017u1 -l /root/.vs-debugger/

EXPOSE 22

```

Build and push this to your registry.

```
docker build -t myregistry/dotnetdebugger .
docker push myregistry/dotnetdebugger

```

Next ensure that your service's build is outputting the [PDB](https://en.wikipedia.org/wiki/Program_database) files as portable PDB files -
*[Offroad Debugging of .NET Core on Linux and OS X from Visual Studio](https://github.com/Microsoft/MIEngine/wiki/Offroad-Debugging-of-.NET-Core-on-Linux---OSX-from-Visual-Studio)*

And ensure that the PDB files are included with the DLL files when you build your service's Docker image.

Then when your container is running and you decide that you need to debug it, you can attach the debugger container as a side car container to the service:

```
docker run -d -p 10222:22 --pid container:<container name> - myregistry/dotnetdebugger

```

Then in Visual Studio, go to menu *Tools* → *Options* → *Crossplatform* → *Connection Manager* - and add a new connection. Specify the IP address or hostname of the container, 10222 as the port (the one in the `docker run` command), and root as the user with no password.
As of May 2018, if you are using Visual Studio, you can use their [official support](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/visual-studio-tools-for-docker?view=aspnetcore-2.1).

You just need to have installed Docker and add the support for Docker projects menu *Project* → *Docker support*.

This creates a new project with a Docker compose and a *dockerfile* to your project, and then Visual Studio links this and allows debugging!