在创建的电子邮件中未创建指向超链接的正确路径 [英] not creating correct path to hyperlink in created email

查看:88
本文介绍了在创建的电子邮件中未创建指向超链接的正确路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有一个发送电子邮件的Web应用程序,并且该电子邮件中包含超链接
我发现这把整个超链接弄乱了,把文件夹弄错了.我进入代码,找到超链接路径中缺少的内容,添加了其余内容,但仍使用旧的,混乱的代码发送电子邮件.另外,我也更改了我希望它发送的电子邮件地址,但是它仍然保留了旧的电子邮件地址.我觉得IIS由于某种原因未使用新代码.我觉得IIS中缺少我需要重新设置的内容,但是我重新启动了网站,但它仍然不使用新的更新代码.我想念什么?

这是执行的代码,如下所示:

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:

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

推荐答案

如果没有任何变化,那么您需要检查是否已将代码以正确的格式发布到正确的位置.
目前,您的代码更改似乎根本没有转移到服务器上.
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.


清除服务器缓存和临时文件-看看是否有帮助. (然后从命令行进行IISRESET)
Clear your server cache and temporary files - see if that helps. (followed by an IISRESET from command line)


每当发生这种情况时,我都会依次执行以下7个步骤.

1.从Visual Studios解决方案资源管理器中刷新我的解决方案.
2.删除所有临时文件,缓存等.
3.在调试时会发生这种情况,关闭所有的asp.net服务(任务栏上日期时间旁边的脚本类型图标).
4.再次重新打开解决方案.
5.再次在IIS上发布并部署代码.确保您也要替换BIN文件夹.
6.通过IISRESET命令重置IIS.
7.即使不起作用,请重新启动计算机/服务器:)
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 :)


这篇关于在创建的电子邮件中未创建指向超链接的正确路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆