c#来自Windows窗体的电子邮件。 [英] c# Email from windows form.

查看:70
本文介绍了c#来自Windows窗体的电子邮件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我一直在搜索关于c#发送电子邮件的很多信息,当用户在标签中写入一些文字时,我想像页面一样gmail会带着输入的东西来找我,我不会喜欢联系我们表格。我也没有数据库。

I've been searching a lot about c# sending email, i would like to do like a page when the user writes in the label some text and the gmail would come go me with entered stuff, i't would be like Contact us form. Also i don't have database.

推荐答案

第一步是知道如何通过
此页面。你真的不能用这种方式创建一个带有填充字段的页面,但是更好(因为你没有数据库)会有一封电子邮件,其中包含要求提供信息并手动查看信息的文本。

Well the first step is knowing how to send an email (via SMTP) via this page. You really can't create a page with fill-in fields this way though yet better (since you don't have a database) would be to have an email with text that ask for information and manually view the information.

如果你真的想要完整的功能,例如提供字段(输入标记)标记,以便在返回给您后读取信息,然后有几个步骤要跟随,包括保存邮件,通过HTMLAgility包读取
输入以及
MsReader
通过NuGet安装)(使用情况见于我的

MSDN代码示例
)到文本文件(因为您没有数据库)或使用Outlook自动化来解析电子邮件中的数据消息。

If you truly want to be full function e.g. provide fields (input tag) tag to read the information once returned to you then there are several steps to follow which include saving the message, reading inputs via HTMLAgility pack along with MsReader (installed via NuGet) (usage can be seen in my MSDN Code Sample) to a text file (since you don't have a database) or use Outlook automation to parse data from email messages.

附注1,通常需要解析将电子邮件保存到 .eml 作为一个文本文件,即使有库,说明它们可能是不可靠的。

Side note 1, saving emails to .eml will usually need to be parsed as a text file even though there are libraries out there stating them can be are unreliable.

附注2,使用gmail如果有可能你需要在Google上设置权限允许通过SMTP接收和发送。

Side note 2, working with gmail if this is a possibility you will need to setup permissions on Google to allow receivingand sending via SMTP.


这篇关于c#来自Windows窗体的电子邮件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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