如何在邮件中发送页面URL [英] how to send page URL in mail

查看:378
本文介绍了如何在邮件中发送页面URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个文本框和一个按钮,我如何发送当前页面的URl作为电子邮件的一部分。如果我在文本框中输入一个电子邮件地址并单击按钮,则应该像您访问的页面一样发送邮件ault.aspx> http:// localhost:7864 / WebSite1 / Default.aspx [ ^ ]

How i can send URl of my current page as part of email for example if i have a textbox and a button. if i enter an email address in textbox and click the button a mail should be send like you visited page "ault.aspx">http://localhost:7864/WebSite1/Default.aspx[^]"

推荐答案

你可以发送url使用下面的代码



u can send url using below code

string sPath = System.Web.HttpContext.Current.Request.RawUrl;





然后在你的电子邮件代码中你发送这个字符串在msg正文如下如下



这里msg是



then in your email code u send this string in msg body like below

here msg is

MailMessage msg = new MailMessage();







msg.Body = "You visited the page"+ sPath;


这篇关于如何在邮件中发送页面URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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