我有一个Web应用程序,需要基于服务器的组件定期访问POP3电子邮箱和检索电子邮件.然后该服务需要处理涉及以下内容的电子邮件:
解决这个问题的最佳方法是什么?我真的不想从头开始编写POP3客户端,但我需要能够自定义电子邮件的处理.理想情况下,我可以插入一些组件,为我进行访问和检索,返回附件数组,正文文本,主题行等,准备好我的处理...
[更新:评论]
好的,所以我花了相当多的时间研究(主要是免费的).NET POP3库,所以我想我会简要回顾下面提到的一些以及其他一些:
在免费图书馆中,我会选择C#Mail或OpenPOP.
我看了几个商业图书馆:Chillkat,Rebex,RemObjects,JMail.net.基于公司的功能,价格和印象,我可能会选择Rebex,如果我的要求发生变化,或者我遇到C#Mail或OpenPOP的生产问题,可能会在将来使用.
如果有人需要它,这是我用C#Mail和OpenPOP启用SSL的替代SslStream构造函数:
SslStream stream = new SslStream(clientSocket.GetStream(), false,
delegate(object sender, X509Certificate cert,
X509Chain chain, SslPolicyErrors errors) { return true; });
Run Code Online (Sandbox Code Playgroud) 这是我的nodemon.json
{
"watch": ["src/**/*.ts"],
"exec": "node out/index.js"
}
Run Code Online (Sandbox Code Playgroud)
我通过执行以下命令来运行nodemon:
nodemon
Run Code Online (Sandbox Code Playgroud)
在root nodejs目录中
这是输出:
% nodemon
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: src/**/*.ts
[nodemon] starting node out/index.js
Yay! Started app!
Run Code Online (Sandbox Code Playgroud)
但是当我在src中编辑任何ts文件时,nodemon不会重启应用程序.
UPDATE
运行 nodemon --watch src/index.ts --exec 'node out/index.js'
在修改index.ts时运行并重新加载应用程序
但是,使用通配符运行
nodemon --watch 'src/**/*.ts' --exec 'node out/index.js'
要么
nodemon --watch src --exec 'node out/index.js'
不重新加载应用程序.
我基于这篇文章对小项目使用令牌认证:http://bitoftech.net/2014/06/09/angularjs-token-authentication-using-asp-net-web-api-2-owin-asp-net -identity /
除了一件事之外,一切似乎都运行良好:基于OWIN的令牌认证不允许/ token端点上的OPTIONS请求.Web API返回400 Bad Request,整个浏览器应用程序停止发送POST请求以获取令牌.
我在应用程序中启用了所有CORS,如示例项目中所示.下面是一些可能相关的代码:
public class Startup
{
public static OAuthBearerAuthenticationOptions OAuthBearerOptions { get; private set; }
public void Configuration(IAppBuilder app)
{
AreaRegistration.RegisterAllAreas();
UnityConfig.RegisterComponents();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
HttpConfiguration config = new HttpConfiguration();
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
ConfigureOAuth(app);
WebApiConfig.Register(config);
app.UseWebApi(config);
Database.SetInitializer(new ApplicationContext.Initializer());
}
public void ConfigureOAuth(IAppBuilder app)
{
//use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(Microsoft.AspNet.Identity.DefaultAuthenticationTypes.ExternalCookie);
OAuthBearerOptions = new OAuthBearerAuthenticationOptions();
OAuthAuthorizationServerOptions OAuthServerOptions = new …Run Code Online (Sandbox Code Playgroud) 以编程方式创建的 UIButton 在按下时不会改变颜色,就像使用 Interface Builder 创建的所有其他按钮一样。
我的按钮创建如下:
let cableDetailsButton = UIButton(type: UIButtonType.System)
cableDetailsButton.frame = CGRectMake(8, 8, 42, 21)
cableDetailsButton.setTitle("Title", forState: UIControlState.Normal)
cableDetailsButton.setTitleColor(self.view.tintColor, forState: .Normal)
cableDetailsButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Highlighted)
cableDetailsButton.addTarget(self, action: #selector(FuseDetailsViewController.cableButtonPressed), forControlEvents: .TouchUpInside)
Run Code Online (Sandbox Code Playgroud)
我想补充一点 tintColor 是默认的 iOS 颜色(蓝色)
我的目标是以编程方式创建与从 Interaface Builder 列表中拖放的按钮相同(默认!)的按钮。我希望我的按钮在按下时更改颜色/alpha。
我正在使用 Swift 2.3
不幸的是,这样简单的任务让我不知所措,以至于我不得不寻求帮助。预先感谢您的帮助。
更新:按钮是 UISCrollView 的一部分