用appengine开发服务器(java)测试邮件 [英] testing mail with appengine development server (java)

查看:158
本文介绍了用appengine开发服务器(java)测试邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用javamail从我的appengine应用程序发送邮件。它在部署中工作得很好,但我无法弄清楚如何使用开发服务器。每当我需要测试sendmail时,我都必须部署非常烦人的应用程序。

I'm using javamail to send mails from my appengine application. It works perfectly in the deployment, but I can't figure out how to do this using the development server. Whenever I need to test the sendmail, I'm having to deploy the application which is quite annoying.

背景信息(为什么日志不起作用):

我们知道电子邮件将发送到appengine开发服务器上的日志。但是,希望从开发服务器发送电子邮件的主要原因是能够测试电子邮件的格式。怎么样?需要对电子邮件模板进行更改,因此在电子邮件客户端A,B和C中看起来不错,并且可以快速完成,而无需每次都会部署到真正的默认应用程序引擎版本。

We know emails go to the logs on the appengine development server. However, the primary reason for wanting to send emails from the development server is to be able to test the format of the email. How does it look? Do changes need to be made to the email template so it looks good in email clients A, B, and C, and can it be done quickly without the hassle of deploying to a real, default appengine version each and every time.

我们不是垃圾邮件发送者。我们不是想规避任何类型的安全。简而言之,我们希望合法地在一个或多个电子邮件客户端中看到真正的实际电子邮件,然后立即进行代码更改,以便我们可以调整它们,而无需经历编辑,编译,等待5分钟的艰苦过程为了部署,测试,重复循环。由于每个电子邮件客户端都没有呈现电子邮件的标准,所以这个艰巨的过程通过尝试在许多客户端得到某些工作来扩大。

We're not spammers. We're not trying to circumvent any type of security. In short, we want to legitimately be able to see the real, actual email in one or more email clients and then make code changes instantly so we can tweak them without having to go through the painstaking process of the edit, compile, wait 5 minutes for it to deploy, test, repeat cycle. Since there are no standards in how each email client renders an email, this painstaking process is amplified by trying to get something to work in many clients.

问题:

如何将Java Google App Engine开发服务器配置为从本地计算机或SMTP服务发送电子邮件,以测试电子邮件发送到真正的实际电子邮件客户端?

推荐答案

从Eclipse中选择运行菜单,调试配置... ,然后选择您的应用程序的
配置。选择参数选项卡,然后在VM参数部分中,设置VM
属性,如下所示:

From Eclipse, select the Run menu, Debug Configurations..., and then select your app’s configuration. Select the Arguments tab, then in the "VM arguments" section, set VM properties like this:

-Dmail.log_mail_level =警告-Dmail.log_mail_body = true

这篇关于用appengine开发服务器(java)测试邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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