简体   繁体   English

从应用程序发送的电子邮件

[英]Email to be sent from the application

I have a scenario wherein When there is any match(can be considered to a trigger), an email notification has be sent from the application to the cusotmer. 我有一种情况,当有任何匹配项(可以认为是触发器)时,电子邮件通知已从应用程序发送到客户。 Basically 'from' id would be the same and 'to' changes. 基本上,“发件人” ID与“发件人” ID相同。 What are the various email sending options available? 有哪些可用的电子邮件发送选项? Im working in Java/JBOSS server. 我在Java / JBOSS服务器中工作。 Should I host a SMTP server? 我应该托管一个SMTP服务器吗? or a cron job which runs and inturn sends emails...either ways I need to find out a method to send email. 或运行并依次发送电子邮件的cron作业...这两种方式都是我需要找出一种发送电子邮件的方法。 Im new to this tech. 我是这项技术的新手。 any inputs appreciated. 任何投入表示赞赏。 Thanks. 谢谢。

1.) As already stated, the Javamail API is the way to go: http://www.oracle.com/technetwork/java/javamail/index.html 1.)如前所述,使用Javamail API是一种方法: http : //www.oracle.com/technetwork/java/javamail/index.html

2.) I further would recommend a wrapper around the Java Mail API that really simplyfies constructing your mails (The Mail API is very hard to work with constructing HTML/Text Emails). 2.)我还建议围绕Java Mail API进行包装,该包装确实可以简化邮件的构造(Mail API很难与HTML / Text Email一起构造)。 I would highly recommend this: http://commons.apache.org/email/ 我强烈建议您这样做: http : //commons.apache.org/email/

3.) As Mail Transfer Agent I would not recommend a Java one but rather use a dedicated SMTP Server, like the mentioned postfix. 3.)作为邮件传输代理,我不推荐使用Java,而是使用专用的SMTP服务器,例如上述的后缀。 With Javamail the SMTP Server can be any arbitrary server, hosted on your own. 使用Javamail,SMTP服务器可以是任意主机,可以自己托管。 Or use services like google mail and you simply connet to them via the java mail API. 或使用诸如Google Mail之类的服务,您只需通过Java Mail API将其连接到网络。 There are no good Java SMTP Servers avilable and postifx has plenty of options (als in regard to security) but from my opinion its the best to use existing infrastructure. 没有可用的Java SMTP服务器,postifx有很多选择(在安全性方面也不错),但我认为这是使用现有基础架构的最佳选择。 With Java Mail you can use your current email provider (or the company email server you might most likely have already). 使用Java Mail,您可以使用当前的电子邮件提供商(或您可能已经拥有的公司电子邮件服务器)。 Your admins only have to creaet a new email address and account and then you can send mails over this account with java mail api. 您的管理员只需创建一个新的电子邮件地址和帐户,然后您就可以使用Java Mail API通过该帐户发送邮件。

Use the JavaMail API to create an e-mail client: 使用JavaMail API创建电子邮件客户端:

http://www.oracle.com/technetwork/java/javamail/index.html http://www.oracle.com/technetwork/java/javamail/index.html

If you don't have an SMTP server, you could install Postfix: 如果您没有SMTP服务器,则可以安装Postfix:

http://www.postfix.org/ http://www.postfix.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何查看来自我的Android应用程序的已发送电子邮件? 还是打算完成(无论发送了什么电子邮件)? - How can I check sent emails from my Android application? Or intent upon completion (regardless of email sent)? 无法在 azure 中部署的 java 应用程序中发送 email - Unable to sent email in java application deployed in azure 无法通过Java从Gmail发送电子邮件 - Cannot sent an Email from Gmail via Java 从Android应用程序发送电子邮件 - Sending email from android application 如何在未安装电子邮件应用程序的情况下从android应用程序发送电子邮件 - How to send Email from android application without installed an email application 春季电子邮件发送状态 - Spring Email Sent Status 不使用 simpleMailMessage 发送电子邮件 - email is not sent using simpleMailMessage 如何使用 Javax.mail.Transport 注册 Trasport 侦听器以听取 email 从 email 服务器发送的状态 - How to register Trasport Listener with Javax.mail.Transport to hear back email sent status from email server 从Android应用程序向php发送日期时,会出现1天的差异 - Getting difference of 1 day when date is sent from android application to php 从Web应用程序中发送/接收电子邮件? - Send/Receive Email from within Web Application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM