Jova
Jova

Reputation: 153

SMTP message not updating it's content

When users register on my site I send them activation mails.

I recently updated the message users receive in the mail but users are still receiving the old message. Anyone know why?

Sorry.

I'm using C#, my website is in ASP.NET MVC.

I'm using a class I've created, Mail.cs, where I create the MailMessage which looks something like this,

public static MailMessage RegistrationMessage(string userName, string userEmail)
    {
        using (MailMessage message = new MailMessage())
        {
            message.From = Mail.MailAdress();
            message.To.Add(new MailAddress(userEmail));
            message.Subject = "Your activation mail";
            message.Body = String.Format(@"Thank you, {0} for joining us!<br/>
                Here's your activation link to activate your new account.<br/>
                http://www.mywebsite.com/Account/Activate/{0}<br/>
                We hope you'll enjoy your stay!", userName);

            return message;
        }            
    }

And then the code that sends the mail in another method,

SmtpClient smtp = new SmtpClient();
                smtp.Send(Mail.RegistrationMessage(userInformation.userName, userInformation.email));

Upvotes: 0

Views: 162

Answers (2)

dave wanta
dave wanta

Reputation: 7214

it sounds like your web application has the older code in memory.

Try adding some innocent whitespace to the web.config, and save it.

That should dump the memory in IIS.

Upvotes: 0

mopoke
mopoke

Reputation: 10685

Assuming you've pushed the code to your production server, did you restart the application?

Upvotes: 1

Related Questions