注册 登录
编程论坛 ASP.NET技术论坛

e-mail何去何从

tm_ma 发布于 2007-03-25 09:51, 1888 次点击

e-mail发不出去,全躲在mailroot里的drop文件夹里,SMTP我设置了,还是不行,我又下了几个组件,w3jmail组件 jmail.dll jmail_new.dll ,我不知道他们是用来干什么的,这日子活不下去了,

11 回复
#2
zhzh2007-03-25 12:34
有点耐心啊,我也被这个搞的很困乏现在!我的也总是发送失败!期待前辈们指点一下
#3
tm_ma2007-03-26 11:42
这个问题有有能回答我吗?大家都很急啊
#4
冰镇柠檬汁儿2007-03-26 11:44
别忘了用cmd注册一下你的组件
#5
Kendy1234562007-03-26 11:44
老大。。。要学会搜啊。。。这个问题的贴我记得有很多贴都讨论过的
#6
tm_ma2007-03-26 12:47
以下是引用冰镇柠檬汁儿在2007-3-26 11:44:37的发言:
别忘了用cmd注册一下你的组件

我搜搜搜,看不懂

#7
xbdeig2007-03-26 13:00
MailMessage mailObj = new MailMessage();
mailObj.From ="xx@lifepop.com";
mailObj.To =To_Email;
mailObj.Subject =""
mailObj.Body =""
mailObj.BodyFormat = MailFormat.Html;
mailObj.BodyEncoding=System.Text.Encoding.Default;
mailObj.Priority = MailPriority.High;
mailObj.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate","1");
mailObj.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "name");
mailObj.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pwd");
SmtpMail.SmtpServer="mail.lifepop.com";
try
{
SmtpMail.Send(mailObj);
return true;
}
catch
{
return false;
}
#8
tm_ma2007-03-26 13:04
什么东东?
#9
xbdeig2007-03-26 13:05
。。。。
#10
zhangp11032007-03-26 16:06
把你的代码法出来给大家讨论讨论,没准能解决你的问题
#11
tm_ma2007-03-26 21:43

<%@ 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>


#12
zhangp11032007-03-27 14:28
不知道你有没有进行web.config的设置。我编写的程序是使用163的邮箱发送出去的,所以我在web.config里面是这这样设置的。
<system.net>
<mailSettings>
<smtp from="zhangp1103@163.com">
<network host="smtp.163.com" password="***" userName="zhangp1103@163.com" />
</smtp>
</mailSettings>
</system.net>
1