如何让电子邮件获得换行? [英] How do I get the email to have line feeds?
本文介绍了如何让电子邮件获得换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让电子邮件获得换行符。它目前一起运行。
<%Const SECTION = 17 %> <%Const SECTION_NAME = internet %>
<%
submitted = request( 提交)
如果提交= true然后
ACC = request( ACC)
FirstName = request( FirstName )
LastName = request( LastName)
Mailing1 = request( Mailing1)
Mailing2 = r equest( Mailing2)
Phone = request( 电话)
电子邮件=请求( 电子邮件)
GCScreenName = request( GCScreenName)
GCRegistrationType = request( GCRegistrationType)
eCScreenName = request( eCScreenName)
eCRegistrationType = request( eCRegistrationType)
' 一切都是必需的,确保没有空白
如果ACC =或FirstName =或LastName =或Mailing1 =或Mailing2 =或Phone =或Email = 或GCScreenNa me =或GCRegistrationType =或eCScreenName =或eCRegistrationType =然后
如果ACC =则
errorMessage =需要ACC编号。
elseif FirstName =然后
errorMessage =名字是必需的。
elseif LastName =然后
errorMessage =姓氏是必需的。
elseif Mailing1 =然后
errorMessage =街道地址是必需的。
elseif Mailing2 =然后
errorMessage =城市/州是必需的。
elseif Phone =然后
errorMessage =电话号码是必需的。
elseif电子邮件=然后
errorMessage =需要电子邮件。
elseif GCScreenName =然后
errorMessage =GameColony屏幕名称是必需的。
elseif GCRegistrationType =然后
errorMessage =GameColony注册类型是必需的。
elseif eCScreenName =然后
errorMessage =eCribbage屏幕名称是必需的。
elseif eCRegistrationType =然后
errorMessage =eCribbage注册类型是必需的。
结束如果
否则
mailfrom = request(email)
mailto =xxxxxxx@gmail.com; xxxxxxxx@hotmail.com
mailsubject =ACC互联网计划 - 屏幕名称注册
mailtext =ACC:& ACC& ,名字:& FirstName& ,姓氏:& LastName& ,邮寄1:&邮寄1& ,Mailing2:& Mailing2& ,电话:&电话& ,电子邮件:&电子邮件& ,GCScreenName:& GCScreenName& ,GCRegistrationType:& GCRegistrationType& ,eCScreenName:& eCScreenName& ,eCRegistrationType:& eCRegistrationType
设置objNewMail = CreateObject(CDONTS.NewMail)
ObjNewMail.Send mailfrom,mailto,mailsubject,mailtext
end if
end if
%>
我的尝试:
我被告知这是经典的asp。我收到的所有内容在收到所有一行时都会发送电子邮件,而不是新行上的每个表格项目。
解决方案
这很明显。您需要在mailtext内的适当位置插入返回/换行符。它们不会出现魔术。请参阅此处的RFC https://tools.ietf.org/html/rfc2822#section-2.3
How do I get the email to have line feeds. It currently runs together.
<% Const SECTION = 17 %> <% Const SECTION_NAME = "internet" %>
<%
submitted = request("submitted")
if submitted = "true" then
ACC = request("ACC")
FirstName = request("FirstName")
LastName = request("LastName")
Mailing1 = request("Mailing1")
Mailing2 = request("Mailing2")
Phone = request("Phone")
Email = request("Email")
GCScreenName = request("GCScreenName")
GCRegistrationType = request("GCRegistrationType")
eCScreenName = request("eCScreenName")
eCRegistrationType = request("eCRegistrationType")
'everything is required, make sure nothing is blank
if ACC = "" or FirstName = "" or LastName = "" or Mailing1 = "" or Mailing2 = "" or Phone = "" or Email = "" or GCScreenName = "" or GCRegistrationType = "" or eCScreenName = "" or eCRegistrationType = "" then
if ACC = "" then
errorMessage = "ACC Number is required."
elseif FirstName = "" then
errorMessage = "First Name is required."
elseif LastName = "" then
errorMessage = "Last Name is required."
elseif Mailing1 = "" then
errorMessage = "Street Address is required."
elseif Mailing2 = "" then
errorMessage = "City/State is required."
elseif Phone = "" then
errorMessage = "Phone Number is required."
elseif Email = "" then
errorMessage = "Email is required."
elseif GCScreenName = "" then
errorMessage = "GameColony Screen Name is required."
elseif GCRegistrationType = "" then
errorMessage = "GameColony Registration Type is required."
elseif eCScreenName = "" then
errorMessage = "eCribbage Screen Name is required."
elseif eCRegistrationType = "" then
errorMessage = "eCribbage Registration Type is required."
end if
else
mailfrom = request("email")
mailto = "xxxxxxx@gmail.com;xxxxxxxx@hotmail.com"
mailsubject = "ACC Internet Program - Screen Name Registration"
mailtext = "ACC:" & ACC & ",FirstName:" & FirstName & ",LastName:" & LastName & ",Mailing1:" & Mailing1 & ",Mailing2:" & Mailing2 & ",Phone:" & Phone & ",Email:" & Email & ",GCScreenName:" & GCScreenName & ",GCRegistrationType:" & GCRegistrationType & ",eCScreenName:" & eCScreenName & ",eCRegistrationType:" & eCRegistrationType
Set objNewMail = CreateObject("CDONTS.NewMail")
ObjNewMail.Send mailfrom, mailto, mailsubject, mailtext
end if
end if
%>
What I have tried:
I was told it is in classic asp. Everything I've tried still gives email when received all one line instead of each item of the form on a new line.
解决方案
It's pretty obvious. You need to insert return/linefeed characters at appropriate points inside mailtext. They don't appear by magic. See the RFC here https://tools.ietf.org/html/rfc2822#section-2.3
这篇关于如何让电子邮件获得换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文