views:

39

answers:

2

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}&lt;br/&gt;
                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));
+1  A: 

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

mopoke
Not sure what you mean with restarting the application?I've used FTP to upload the changes. The website is at a web hosting company server and not on a server owned by me.
Jova
Did you make sure you uploaded the dll that is created by your MVC project?
metanaito
A: 

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.

Cheers!

Dave

dave wanta
It wasn't the web.config specifically but the application had older code in memory. I had to update everything.
Jova