邮件问题啊 简单邮件发送需要服务器验证

mmiiaaoo 2003-08-31 12:31:57
大家能否给我事例 vb版啊


大出血啊 全压上50分 别说分少
我就怎么点啊
大家救命要紧啊
...全文
229 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
waki 2003-09-10
  • 打赏
  • 举报
回复
使用这种方式实现有缺陷的,它的前提条件是邮件服务器上安装的是MS的EXCHANGE,这样才可以使用它的CDO对象来进行验证。而现在网上大部分的邮件服务器都装的不是这个,所以实际上是不可行的。除非是在企业应用中。
可以使用我做的邮件发送控件,支持验证,发送附件,可以使用VB或者C#语言调用。还可以得到我以后的更新升级。下载地址:www.aspxcontrol.com
Surpass 2003-09-10
  • 打赏
  • 举报
回复
友情UP
mmiiaaoo 2003-09-10
  • 打赏
  • 举报
回复
你的控件我已经使用过了啊
怎么不行啊
ArLi2003 2003-09-05
  • 打赏
  • 举报
回复
http://www.zpcity.com/arli/commonprj/cls_Mail.cs

ps: 0x0804 是语言代码,过去是没有内置const 的,都是自己const 或者 incude *.h 文件,所以有些人直接用int 值
mmiiaaoo 2003-09-05
  • 打赏
  • 举报
回复
Dim objmailmessage As New MailMessage
Dim from As String
from = "web@zdsw.com"
objmailmessage.From = from
objmailmessage.To = TextBox2.Text
objmailmessage.Subject = "欢迎成为浙东商务网的会员,下面是你的登陆密码!你可以在我的办公室里修改密码!"
objmailmessage.Body = "请以" & "ID:" + TextBox1.Text + ",密码:" + strpasswd + ",登录浙东商务网"
'objmailmessage.BodyFormat = MailFormat.Html


objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'如果用smtp(Server用外部的, 请您把SendUsing设为2, 内部设为1)
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = from

objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname") = from
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = from
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/cdoSMTPServerPort") = 25
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "8833633"
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'value=0 代表Anonymous验证方式(不需要验证)
'value=1 代表Basic验证方式(使用basic (clear-text) authentication.
'The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
'Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/languagecode") = " 0x0804"
objmailmessage.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "zdsw.com.cn"




SmtpMail.Send(objmailmessage)
mmiiaaoo 2003-09-04
  • 打赏
  • 举报
回复
0x0804
什么意思啊
我做了出现代码错误啊
那用什么代码呢
mmiiaaoo 2003-09-04
  • 打赏
  • 举报
回复
("http://schemas.microsoft.com/cdo/configuration/smtpserver")
什么意思啊
cnhgj 2003-09-04
  • 打赏
  • 举报
回复
帮你转成VB的

public sub SMTPSendMail(strSmtpServer as String,strFrom as string strFromPass as string,strto as string,strsubject as string,strBody as string)
dim myMail as MaiMessage = new MailMessage
myMail.From = strFrom
myMail.To = strto
MyMail.Subject = strSubject
myMail.Priority = Mailpriority.Low
myMail.BodyFormat = MailFormat.Text
myMail.Body = strBody
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = strFrom
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpaccountname") = strFrom
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = strFrom
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strFromPass
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/languagecode") = 0x0804
myMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmtpServer
SmtpMail.Send(myMail)
end sub
mmiiaaoo 2003-08-31
  • 打赏
  • 举报
回复
申明服务器不是本机啊
carper 2003-08-31
  • 打赏
  • 举报
回复
vb.net 写的没有,C# 倒有一个,懒得转换了。

/// <summary>
/// 使用远程需要密码验证的mail服务器发送Email的函数
/// </summary>
/// <param name="strSmtpServer">远程服务器名</param>
/// <param name="strFrom">默认发送人</param>
/// <param name="strFromPass">发送人验证密码</param>
/// <param name="strto">发送到</param>
/// <param name="strSubject">主题</param>
/// <param name="strBody">内容</param>
/// <permission cref="System.Security.PermissionSet">private</permission>
private static void SMTPSendMail(string strSmtpServer,string strFrom,string strFromPass,string strto,string strSubject,string strBody)
{
MailMessage myMail=new MailMessage();
myMail.From = strFrom;
myMail.To = strto;
myMail.Subject = strSubject;
myMail.Priority = MailPriority.Low;
myMail.BodyFormat = MailFormat.Text;
myMail.Body = strBody;
// 每个值对应说明看:
//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdosys/html/_cdosys_cdoconfiguration_module.asp
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
//如果用smtp Server用外部的,请您把SendUsing设为2,内部设为1
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"] = strFrom;
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"] = strFrom;
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = strFrom;
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = strFromPass;
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
//value=0 代表Anonymous验证方式(不需要验证)
//value=1 代表Basic验证方式(使用basic (clear-text) authentication.
//The configuration sendusername/sendpassword or postusername/postpassword fields are used to specify credentials.)
//Value=2 代表NTLM验证方式(Secure Password Authentication in Microsoft Outlook Express)
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/languagecode"] = 0x0804;
myMail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"] = strSmtpServer;
SmtpMail.Send(myMail);
}

适用人群通用各大网易系,腾讯QQ系,新浪系,阿里系等主流邮箱;同时也适用于企业开发的企业邮箱,进行收件和发件。课程概述通用各大网易系,腾讯QQ系,新浪系,阿里系等主流邮箱;同时也适用于企业开发的企业邮箱,进行收件和发件。POP3是Post Office Protocol 3的简称,即邮局协议的第3个版本,它规定怎样将个人计算机连接到Internet的邮件服务器和下载电子邮件的电子协议。它是因特网电子邮件的第一个离线协议标准,POP3允许用户从服务器上把邮件存储到本地主机(即自己的计算机)上,同时删除保存在邮件服务器上的邮件,而POP3服务器则是遵循POP3协议的接收邮件服务器,用来接收电子邮件的SMTP 的全称是“Simple Mail Transfer Protocol”,即简单邮件传输协议。它是一组用于从源地址到目的地址传输邮件的规范,通过它来控制邮件的中转方式。SMTP 协议属于 TCP/IP 协议簇,它帮助每台计算机在发送或中转信件时找到下一个目的地。SMTP 服务器就是遵循 SMTP 协议的发送邮件服务器。   SMTP 认证,简单地说就是要求必须在提供了账户名和密码之后才可以登录 SMTP 服务器,这就使得那些垃圾邮件的散播者无可乘之机。。【开发者如何进行快速开发邮件发送系统???本课程系统进行快速研发,项目实战】 部分截图如下:完整版请查看课件或者视频

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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