可以使用诸如send,recv之类的窗口套接字功能与Web服务器进行通信. [英] Can window socket functions like send , recv be used to communicate with web servers.

查看:76
本文介绍了可以使用诸如send,recv之类的窗口套接字功能与Web服务器进行通信.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用诸如send,recv之类的窗口套接字功能与Web服务器通信.


我的Windows客户端/服务器应用程序是否可以使用send和recv功能或任何其他功能与Web服务器进行通信.

我希望使Windows客户端/服务器应用程序能够使用SMTP发送电子邮件并发送SMS.

现在,我将讨论客户端在尝试向服务器发送电子邮件时进行的结构化讨论.我需要知道如何与服务器(尤其是Web服务器)进行通信,以便可以向它们发送电子邮件.

Can window socket functions like send , recv be used to communicate with web servers.


Is it possible for my windows client/server application to communicate with web servers using send and recv functions or any other functions.

I wish to make my windows client/server application to be able to send e-mails using SMTP and also to send SMS.

I now now the stuctured discussion that client carry out when attempting to send e-mails to server. I need to know how to communivate with servers specifically web severs to that I can send e-mails to them.

推荐答案

要使用SMTP服务器发送邮件,请参阅RFC 5321 [ ^ ]和Wikipedia [ ^ ].

Web服务器使用不支持发送邮件的HTTP协议.如果要使用特定网页的邮件形式或Web邮件服务器发送邮件,则可以通过模拟像Web浏览器这样的数据传输来了解邮件数据的发送方式,从而做到这一点.但这总是特定于所使用的Web服务,并且在该服务更改其页面或所使用的脚本时必须对其进行调整.
To send mails using a SMTP server see RFC 5321 [^] and the Wikipedia [^]. When not using an encrypted connection, this is quite simple. If you don''t want to implement it yourself, you may use a SMTP library.

You may also use the Windows MAPI interface [^] to send mails.

Another option is using the Windows Mail interface [^].

Web servers use the HTTP protocol which did not support sending mails. If you want to use a mail form of a specific web page or a web mail server to send mails, you can do that if you know how the mail data are send by emulating the data transfer like a web browser. But this is always specific to the used web service and must be adjusted when the service changes his page or used scripts.


所有最常用的Internet协议基于套接字,基于相同的原理,并使用RFC定义的文本交换约定.您可以对任何协议使用相同的套接字层功能,并且仅对数据内容使用协议特定的内容(对于真正的严肃邮件和http客户端来说,这有点复杂,但是基本思想是相同的.)

因此,如果您找到了一个方便的基于套接字的函数集或类集,或者想要的任何东西(甚至是您自己的函数集,类的集合,无论您想要什么),那么您只需正确地应用考虑过的RFC.

祝您好运
All most used Internet protocols are based on sockets, over the same principle, and using a text exchange convention, which is RFC defined. You can use the same socket layer functions for any protocols, and do protocol specifics with data content only (it''s a bit more complicated for real serious mail and http clients, but the basic idea is the same).

So if you find a convenient socket based set of functions, or classes, or whatever you want (even your own set of functions, classes, whatever you want), you just have to apply correctly the considered RFC.

Good luck


此外,如果您要使用HTTP,请与Jochen Arndt一起回答
Additionally to Jochen Arndt''s answer, if you want to use HTTP, take a look at the WinINet[^] API.


这篇关于可以使用诸如send,recv之类的窗口套接字功能与Web服务器进行通信.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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