Click here to Skip to main content
16,016,022 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

I have a web application that sends out an email, and the email contains a hyperlink in it
I found it was messing up the whole hyperlink to the wrong folder. I went in the code, found what was missing in the hyperlink path, added the rest of it, but its still sending email using the old, messed up code. Also, I changed the email address i wanted it to send too, but its still sedning to the old email addresses. I feel as if IIS is not using the new code for some reason. I feel that theres something I'm missing in IIS that needs a reset, but i restarted the website, and it still doesnt use the new updated code. What am I missing?

Here's what the code that executes looks like:

C#
try 
            { 
                string sendtoSales = ccTB.Text; 
                string href = "http://mr.tth/MakeReadyDONE/" + newFilename + ".pdf"; 
                MailMessage message = new MailMessage(); 
                message.To.Add("taysseer@email.ca"); 
                message.To.Add("mr@email.ca"); 
                message.To.Add(ccTB.Text); 
                message.Subject = "A new mr has been created: #" + newFilename; 
                message.From = new MailAddress("mr@email.ca"); 
                message.IsBodyHtml = true; 
                if (TextBox1.Text == "") 
                { 
                    message.Body = "Link to new MR: " + "\n<a href=\"" + href + "\">Click Here</a> <p><p> Submitted by" + createnew.BusinessMgr; 
                } 
                else 
                { 
                    message.Body = "Link to new MR: " + "\n<a href=\"" + href + "\">Click Here</a> <p><p>" + createnew.BusinessMgr + " commented: " + TextBox1.Text; 
                } 
                SmtpClient smtp = new SmtpClient("xch1.email.ca", 25); 
                smtp.DeliveryMethod = SmtpDeliveryMethod.Network; 
                smtp.UseDefaultCredentials = false; 
                smtp.Credentials = new NetworkCredential("mr", "password", "mremail"); 
                smtp.Send(message); 
            } 
            finally { 
                Response.Redirect("sentemailRESULT.aspx"); 
            } 



Thanks in advance
Posted

If no changes are making a difference, then you need to check that you have published the code to the right place, and in the right format.
At the moment, it sounds like your code changes are not being transferred to your server at all.
 
Share this answer
 
Clear your server cache and temporary files - see if that helps. (followed by an IISRESET from command line)
 
Share this answer
 
Whenever such thing happen I follow the following 7 Steps one by one in order.

1. Refresh my solution from Visual studios Solution explorer.
2. Delete all temporary files , cache etc.
3. Close all asp.net services (a script type icon which comes next to date-time in taskbar) in this happens while debugging.
4. Re-Open the Solution again.
5. Publish and deploy the code again on IIS. Make sure that you are replacing BIN folder too.
6. Reset IIS by IISRESET command.
7. Even if it doesn work , Restart your computer/server :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900