e-mail发不出去,全躲在mailroot里的drop文件夹里,SMTP我设置了,还是不行,我又下了几个组件,w3jmail组件 jmail.dll jmail_new.dll ,我不知道他们是用来干什么的,这日子活不下去了,
<%@ import namespace="system.IO"%>
<%@ import namespace="system.web.mail"%>
<script language="vb" runat="server">
sub enter_click(sender as object,e as eventargs)
dim filename as string
dim filepath as string
filename=path.getfilename(uploadfile.value)
filepath="c:\inetpub\wwwroot\asp.net\chapter3\upload\" & filename
uploadfile.postedfile.saveas(filepath)
dim objmail as new mailmessage
objmail.from=mailfrom.text
objmail.to=mailto.text
objmail.subject=subject.text
dim objattach as new mailattachment(filepath)
objmail.attachments.add(objattach)
smtpmail.smtpserver=""
smtpmail.send(objmail)
message.text="发送成功"
end sub
</script>
<html>
<body>
<h2>在线发送e-mail</h2>
<form runat="server">
发信人:<asp:textbox id="mailfrom" runat="server"/><br>
收信人:<asp:textbox id="mailto" runat="server"/><br>
主 题: <asp:textbox id="subject" runat="server"/><br>
内容: <asp:textbox id="body" textmode="multiline" rows="4" cols="40" runat="server"/><br>
附件: <input type="file" id="uploadfile" runat="server"/><br>
<asp:button id="enter" text="发送" onclick="enter_click" runat="server"/>
<br><asp:label id="message" runat="server"/>
<asp:label id="message1" runat="server"/>
</form>
</body>
</html>