C++允许文件附件的 SMTP
我希望创建一个允许添加文件附件的 SMTP,但是我发现很难找到教程。我发现了一件很接近的事情,那就是 https://stackoverflow.com/questions/58210/c-smtp-example 但是,由于使用了包含文件,因此在 VS2005/2010 中无法编译。
我想推出自己的库,而不是适应某些库,例如 Curl 或 Boost。有没有人对如何做到这一点有任何建议,或者一些带有良好文档的小示例代码可以在 Visual Studio 中编译?
I am looking to create an SMTP that allows for file attachments, however, I am finding it difficult to locate a tutorial. I have found one close thing, which is https://stackoverflow.com/questions/58210/c-smtp-example , however, this fails to compile in VS2005/2010 because of the include files that are used.
I would like to roll my own and not adapt to some library such as Curl or Boost. Does anyone have any suggestions on how to do this, or some small sample code with good documentation that will compile in Visual Studio?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基于我对上一个问题的回答,使用Microsoft ATL 类包含在 Visual Studio 的付费版本中。
AttachFile 调用中提供的 MIME 类型取决于附件的类型。
Building on my answer to a previous question, using the Microsoft ATL classes which are included in the paid versions of Visual Studio.
The MIME type supplied in the AttachFile call will depend on the type of attachment.
有几种方法可以制作附件。您可以使用 UUEncoded 或 MIME 格式。如果您想自己动手,UUEncoded 会简单得多。
There are a couple of ways to do attachments. You can use UUEncoded or MIME formatting. The UUEncoded is much simpler if you want to roll your own.