如何在不指定带有java的smtp服务器的情况下发送邮件? [英] How Do I send a mail without specifying the smtp server with java?

查看:261
本文介绍了如何在不指定带有java的smtp服务器的情况下发送邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!



我是java中的初学者



我的项目是基于struts2 + spring + hibernate的web项目。



我想发送邮件而不指定java。



几乎所有例子都需要指定smtp服务器,但我只想指定2个电子邮件地址。



请帮助我。

Hi!

I am a beginner in java.

My project is a web project based on struts2 + spring + hibernate.

I want to send a mail without specifying java.

Almost Examples needs to specify the smtp server, but I want specify only 2 email addresses.

Please help me.

推荐答案

您可能认为此处只涉及2个系统,但至少有3个。



当您发送电子邮件时对于传统的电子邮件地址,您实际上是将其发送到邮件服务器。用于发送到服务器的协议(通常)是SMTP。 [电子邮件服务器可能是也可能不是SMTP服务器。]当收件人去阅读邮件时,它使用POP3协议从邮件服务器请求任何未完成的邮件。



除非你发明自己的邮件协议,否则你真的无法使用SMTP服务器。



我在这里描述的是SMTP / POP3连接,这是最流行的,但不是唯一的配置。还有其他(例如IMAP,X.500,X.25,......)但是没有涉及两台机器的常见情况(例外:VMS Mail)。



您确实需要在某处包含SMTP服务器(特别是如果您使用SMTP协议)。
You might think you are only involving 2 systems here but there are at least 3.

When you send an email to a conventional email address, you are really sending it to a mail server. The protocol used to send to the server is (usually) SMTP. [The email server may or may not be the SMTP server.] When the recipient goes to read the message, it uses POP3 protocol to request any outstanding messages from the mail server.

Unless you invent your own mail protocol, you really can''t get away from use of an SMTP server.

What I have described here is the SMTP/POP3 connection, which is the most popular, but not the only configuration. There are others (eg. IMAP, X.500, X.25, ...) but there are no common situations which involve two machines (exception: VMS Mail).

You really need to include an SMTP server somewhere (especially if you use the SMTP protocol).


http://static.springsource.org/spring/docs/2.0.x/reference/mail.html [ ^ ]


这篇关于如何在不指定带有java的smtp服务器的情况下发送邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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