我在我的网站上使用了这个脚本来收集访问者的查询表单信息。我的一位客户报告说,当他收到生成的电子邮件时,Outlook 正在操纵这条线:
电子邮件=myclient@myclientsdomain.com
...包括前缀“email=”,就好像这是电子邮件的一部分!(愚蠢的前景!)
我需要更改我的代码,以便在电子邮件地址之前立即插入一个前导空格,使其看起来更像这样:
电子邮件= myclient@clientsdomain.com
这样,当我的客户单击电子邮件以回复用户时,将使用正确的电子邮件(电子邮件前面没有附加前缀的电子邮件!)
总之,Outlook 在创建电子邮件链接时包含前缀,因为电子邮件和前缀之间没有任何空格。
我不是一个编码员,广泛的搜索让我失望了。我尝试了很多建议,但我的表格似乎要么失败,要么没有修复。
<!--START CODE FOR SENDFORM.ASP -->
<%@ LANGUAGE="VBScript" %>
<%
Dim sFormTitle, sFormSender, sFormSubject, sFormDestination
'============================================
' You only need to change the details below!
'============================================
sFormTitle = "enquiries"
sFormSender = “myemail@mydomain.com"
sFormDomain = “mydomain.com"
sFormSubject = "Enquiry From Website."
sFormDestination = “me@mydomain.com"
'sFormDestination = “mail@mydomain.com"
'============================================
' And that's it!
'============================================
Dim sRawForm, aFormArray, sElement, sFormData
sRawForm = request.form
aFormArray = Split(sRawForm, "&")
for i = 0 to UBOUND(aFormArray)
sElement = Unescape(aFormArray(i))
sElement = Replace( sElement, "+", " " )
sFormData = sFormData & sElement & vbCrLf
next
%>
<%
Dim sRecipients, sBody, sSubject
sRecipients = Request.Form( sFormDestination )
sBody = sFormData
sSubject = sFormSubject
dim msg
set msg = Server.CreateOBject( "JMail.SMTPMail" )
msg.Logging = true
msg.silent = true
msg.Sender = sFormSender
msg.SenderName = sFormTitle
msg.AddRecipient sFormDestination
msg.Subject = sSubject
msg.Body = sBody
msg.ServerAddress = "IP GOES HERE - REMOVED IT FOR THIS POSTING"
if not msg.Execute then
Response.redirect "http://mydomain.co.uk/sorry.html"
else
Response.redirect "http://mydomain.co.uk/thanks.html"
end if
%>
<!--END CODE FOR SENDFORM.ASP -->
根据 LANKYMART 的建议编辑以下内容:
Lankymart - Outlooks 看到文本字符串 email=myclient@myclientsdomain.com 在中间包含一个 @ 符号,并将整个内容解释为电子邮件地址 - 因此它使整个内容成为可点击的电子邮件链接。如果我的表单可以生成一个不间断的空格,Outlook 仍会将该链接设为电子邮件链接,但不会包含不需要的前缀。
我不能使用 - 我不知道如何使用脚本自动插入它(这就是我要问的)。也许您的意思是在我的 html 表单页面上 - 这不会“传递”到批量发送的电子邮件。
方括号也有同样的问题——如果 asp 表单可以以某种方式自动为我插入这些,电子邮件将到达并且 Outlook 可能会正确显示它——让我的表单执行此操作是我需要知道的部分。(我觉得领先的空间可能会更好,因为这肯定会起作用)
还有其他想法吗?