很菜的问题

MRelephant 2003-10-16 10:19:01
dim str
str=str&"您好!"
Set theMail=Server.CreateObject("CDONTS.NewMail")
theMail.From = "xiangluan@1010.com"   
theMail.To = "xiang1luan2@sina.com"   
theMail.Subject ="电子邮件功能测试!"   
theMail.BodyFormat=0   
theMail.MailFormat=0   
theMail.Body=Str     
On Error Resume Next
theMail.Send
set theMail=nothing

输出:
无效字符

/asp/shiyan/cdont.asp,行16

theMail.From = "xiangluan@1010.com"   
----------------------------------^
...全文
40 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
MRelephant 2003-10-16
  • 打赏
  • 举报
回复
哦,为什么发不到新浪的邮箱?
空闲独处 2003-10-16
  • 打赏
  • 举报
回复
你在这几句的末尾全部加了全角空格,把它删掉就可以了
theMail.From = "xiangluan@1010.com"   
theMail.To = "xiang1luan2@sina.com"   
theMail.Subject ="电子邮件功能测试!"   
theMail.BodyFormat=0   
theMail.MailFormat=0   
theMail.Body=Str
xxrl 2003-10-16
  • 打赏
  • 举报
回复
theMail.From = "xiangluan@1010.com"
是不是后面有什么字符?将后面清空
然后将引号重新用英文输入.
MRelephant 2003-10-16
  • 打赏
  • 举报
回复
怎么你的没错呢?
roymans 2003-10-16
  • 打赏
  • 举报
回复
可能是你的服务器上没装SMTP服务,建立CDONTS.NewMail对像没有成功,所以出错!
MRelephant 2003-10-16
  • 打赏
  • 举报
回复
你的真没问题,这是怎么回事呀?
angelheavens 2003-10-16
  • 打赏
  • 举报
回复
在你的语句后有空白字符,试试下面的,是我改好的:

<%
dim str
str=""
str=str&"您好!"
Set theMail=Server.CreateObject("CDONTS.NewMail")
theMail.From="xiangluan@1010.com"
theMail.To="xiang1luan2@sina.com"
theMail.Subject ="电子邮件功能测试!"
theMail.BodyFormat=0
theMail.MailFormat=0
theMail.Body=Str
On Error Resume Next
theMail.Send
set theMail=nothing
%>
MRelephant 2003-10-16
  • 打赏
  • 举报
回复
我去掉错误的一行,出错就在下一行!
pp4u 2003-10-16
  • 打赏
  • 举报
回复
str="" + "您好!"
holdy 2003-10-16
  • 打赏
  • 举报
回复
不是输入全角字符的缘故吧

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧