找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 89|回复: 2

求助!关于发送邮件出现:服务器拒绝了发件人地址,这一问题!

[复制链接]
发表于 2010-1-9 03:58:21 | 显示全部楼层 |阅读模式 IP:江苏扬州
代码如下:     (请高手帮我看下!)
         <%@ Page Language="VB" %>
<%@ import Namespace="System.Web.Mail"%>
<script language="vb" runat="server">
sub Button_Click(sender As object,e As EventArgs)
dim mail as MailMessage = New MailMessage()
mail.To=mailTo.text
mail.From=mailFrom.text
mail.subject=mailsubject.text
mail.Body=mailBody.text
if Format.Selecteditem.text="纯文本格式" then
mail.BodyFormat=mailFormat.text
else
mail.BodyFormat=mailFormat.Html
end if
dim File as HttpPostedFile=FileUp.postedFile
if file.ContentLength<>0 then
dim FileSplit() as string=Split(File.FileName,"\")
dim Filename as string=fileSplit(fileSplit.length-1)
file.SaveAs(Server.MapPath(FileName))
dim attach As New MailAttachment(Server.MapPath(FileName))
mail.attachments.add(attach)
end if
On error Resume Next
smtpmail.smtpserver="pop3.163.net"
smtpmail.send(mail)
if err.number<>0 then
msg.text=err.Description
else
msg.text="邮件已经送出!"
end if
end sub
</script>
<html>
<head>
<title>发送邮件</title>
<style type="text/css">
<!--
.style1 {
    font-size: 36px;
    color: #00FF00;
    font-family: "华文隶书";
}
-->
</style>
</head>
<body bgcolor="white">
<h2 align="center" class="style1">发送电子邮件!  </h2>
<h2>
  <hr>
</h2>
<form runat="server">
<table border="0">
<tr>
<td>收件人:</td>
<td><asp:TextBox ID="mailto" size=40 runat="server"/></td>
</tr>
<tr>
<td>寄件人:</td>
<td><asp:TextBox ID="mailFrom" size=40 runat="server"/></td>
</tr>
<tr>
<td>主题:</td>
<td><asp:TextBox ID="mailsubject" size=40 runat="server"/></td>
</tr>
<tr>
<td>正文:</td>
<td><asp:TextBox ID="mailbody" size=40 TextMode="MultiLine" Rows="20" Columns="60" runat="server"/>
<br><asp:RadioButtonList ID="Format" runat="server" RepeatDirection="Horizontal" RepeatColumns="2">
<asp:ListItem Selected>Html 格式</asp:ListItem>
<asp:ListItem>纯文本格式</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>附件:</td>
<td><input type="file" ID="fileUp" runat="server"/></td>
</tr>
</table>
<asp:Button runat="server" Text="送出" OnClick="Button_Click"/>
<asp:Label ID="Msg" runat="server" ForeColor="red"/><p></p>
</form>
</body>
</html>
发表于 2010-2-22 13:05:19 | 显示全部楼层 IP:泰国
哈哈,好怕怕~~我每次看帖必回的~~藏了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 17:32 , Processed in 0.204173 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表