[c#winform] telnet,smtp服务器auth。 [英] [c# winform] telnet, smtp server auth.

查看:99
本文介绍了[c#winform] telnet,smtp服务器auth。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有了一些代码,允许我连接到smtp服务器并验证ip(只检查超时)。无论如何,我现在需要应用程序检查其给定的用户和密码是否可以访问smtp以发送电子邮件。我的代码如下。

展开 | 选择 | Wrap | 行号

解决方案

如果您正在与SMTP服务器通话,查找SMTP命令。

给予EHLO<您的计算机身份>+ [输入]应该会给您回复,告诉您可用的AUTH类型。

然后你可以向AUTH用户发送正确的命令序列。


可以找到AUTH命令扩展的rfc 这里



如果您正在与SMTP服务器通话,请查找SMTP命令。 />
给予EHLO<您的计算机身份>+ [输入]应该会给您回复,告诉您可用的AUTH类型。

然后您可以发送正确的命令序列给AUTH用户。


可以找到AUTH命令扩展的rfc 这里



是的,我知道我需要使用的命令或者我可以查找它们。但我只是不确定如何从程序中将命令发送到服务器。


我基本上检查了一个smtp服务器,我的用户使用该应用程序向人们发送电子邮件在数据库中。


现在设置应用程序,他们管理员将需要放入smtp ip,用户名和密码(如果需要)。我上面的代码检查IP地址响应。现在我需要它进行身份验证并检查它是否同时响应。


关于如何从应用程序发送命令的任何想法?只是和ehlo或其他什么然后我可以解决身份验证和自己的东西。


再次感谢,

Piercy


< blockquote>在我为smtp制作的程序中,我有一个活动套接字连接smtp服务器。 (我认为这是一个真正的smtp服务器是吗?)

在套接字上我发送命令为ASCII字符串


EHLO格式:

展开 | 选择 | Wrap | 行号


I''ve already got some code in place which allows me to connect to a smtp server and verify the ip(just checks for a timeout.). anyway, i now need the app to check that the user and password its given has access to the smtp to send email. the code i have is as follows.

Expand|Select|Wrap|Line Numbers

解决方案

If you are talking to the SMTP server, look up the SMTP commands.
Giving the "EHLO <your computer identity>"+[enter] should give you a response back telling you what AUTH types are available.
You can then send the correct sequence of commands to AUTH the user.

The rfc for the AUTH command extension can be found here


If you are talking to the SMTP server, look up the SMTP commands.
Giving the "EHLO <your computer identity>"+[enter] should give you a response back telling you what AUTH types are available.
You can then send the correct sequence of commands to AUTH the user.

The rfc for the AUTH command extension can be found here

yes, i know the commands i need to use or i cna look them up. but im just not sure how i would send the commands to the server from the program.

im basically doing a check for a smtp server, my users use the application to send emails to people in a database.

now on settings up the app they admin will need to put in the smtp ip, username and password if required. the code i have above check the ip address responds. now i need it to authenticate and check it responds at the same time.

any ideas on how to send the commands from the app? just and ehlo or something then i can work out the auth and stuff myself.

Thanks once again,
Piercy


In the program I made for smtp, I had an active socket connection the smtp server. (I presume that this is a real smtp server yes?)
On the socket I send the commands as ASCII strings

Format of EHLO:

Expand|Select|Wrap|Line Numbers


这篇关于[c#winform] telnet,smtp服务器auth。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆