我需要使用vb.net代码格式化来自mailto链接的电子邮件文本。输出仅显示变量Client Name。它将显示整个字符串,而不包含消息中的sb变量。调试并在断点处查看消息变量时,它包含stringbuilder和string。是否可以将字符串与字符串生成器连接以进行mailto链接?我在为消息变量调试应用程序时看到的输出是:
客户名称:123打印请填写以下新服务类别的订单项:%0ANew服务类别:%0ABusiness Development Manager名称:%0AClient服务经理姓名:%0ARevenue:%0ARevenue开始日期:%0AClient联系人姓名:% 0AClient联系电话:%0AClient联系电子邮件地址:%0A
返回到屏幕的所有内容都是'客户名称:123打印
Dim sb As New StringBuilder
Dim clientName As String = Session("ClientName")
Dim clientID As String = Convert.ToString(Session("myCNECTID"))
sb.Append("Client Name :" & clientName)
sb.AppendLine()
sb.Append("CNECT ID: " & clientID)
Dim message As String = _
sb.ToString + "Please complete below line items for a new service category:%0ANew Service category:%0ABusiness Development Manager Name:%0AClient Service Manager Name:%0A" _
& "Revenue:%0ARevenue Start Date:%0AClient Contact name:%0AClient contact phone:%0AClient contact Email address:%0A"
HyperLink1.NavigateUrl = ConfigurationManager.AppSettings("sfEmail").ToString() + "?subject=Request to add new service opportunity in SF for CBIZsolutions&body= " & message
答案 0 :(得分:0)
对于UrlEncode, 将%0D%0A代替%0A 就是这样:)