可以通过编程方式发送电子邮件,而不使用任何实际的电子邮件帐户 [英] Is it possible to send an email programmatically without using any actual email account

查看:333
本文介绍了可以通过编程方式发送电子邮件,而不使用任何实际的电子邮件帐户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑在游戏中实施报告错误/建议选项,但是我不太清楚我如何能够得到这个工作。我没有我自己的服务器或任何东西,所以我不能发送用户写的文本。

I'm thinking of implementing "Report a bug/Suggestions" option to my game, however I am not quite sure how I could get that working. I do not have my own server or anything, so I can't just send the text that user has written to there.

我想到的唯一方法是客户端会写一个消息,我会将其发送到我可以阅读它们的电子邮件帐户。但是,我不希望用户需要通过个人账户发送报告。我不太确定如何实现这一点,而谷歌搜索没有提出任何好的建议。

The only way I came up with is that the client would write a message and I would send it to an email account where I could read them. However, I do not want that users would need to send the reports through their personal accounts. I am not quite sure how I could implement this and googling didn't bring up any good suggestions.

我没有做过很多网络的东西,所以我'如果您可以逐步解释(甚至在代码中)进程,那么真的很感激。

I haven't done a lot of network stuff, so I'd really appreciate it if you could explain ( possibly even in code ) the process step-by-step.

我正在使用C#,游戏正在为Windows Phone 7编程。

I am using C# and the game is being programmed for Windows Phone 7.

推荐答案

是的,绝对可以这样做。从相对较低的角度来看,您需要:

Yes, it is absolutely possible to do that. From a relatively low-level perspective, you need to:


  1. 解决电子邮件帐户的MX(邮件交换)服务器要发送到。

  2. 向MX服务器打开套接字。

  3. 发送相应的 SMTP命令使电子邮件被传送到收件人帐户。你本质上有自由设置从地址是任何你想要的任何东西。

  1. Resolve the MX (mail-exchanger) server for the e-mail account you want to send to.
  2. Open a socket to the MX server.
  3. Send the appropriate SMTP commands to cause the e-mail message to be delivered to your recipient account. You essentially have the freedom to set the "from" address to be any arbitrary thing you want.

SMTP是一个非常简单/人友好的协议,所以手动完成所有这一切并不是一个巨大的努力。同时,还有一些预构建的库将处理所有这些对于您(除了可能的收件人的MX服务器的分辨率)。

SMTP is a very simple/human-friendly protocol, so it's not a massive effort to do all of that by hand. At the same time, there are a number of prebuilt libraries that will handle all of that for you (except possibly the resolution of the recipient's MX server).

请注意,以这种方式发送的电子邮件更有可能被过滤掉为垃圾邮件(通常是因为发件人的IP / hostname不会匹配您决定使用的传出电子邮件地址的任何域名)。

Note that emails sent this way are more likely to be filtered out as spam (generally because the sender's IP/hostname is not going to match whatever domain you put on the outgoing e-mail address you decide to use).

另请注意,由于您可以将从地址设置为任何内容,您可以选择询问用户是否要提供其实际的联系人地址,如果他们可以使用从地址,以便您可以在必要时实际与他们联系。

Also note that since you can set the "from" address to anything, you have the option of asking the user if they want to provide their actual contact address, and if they do you can make that the "from" address so that you can actually get back in touch with them if necessary.

这篇关于可以通过编程方式发送电子邮件,而不使用任何实际的电子邮件帐户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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