Someone knows a mail (SMTP) delivery library for Java?

前端 未结 3 1702
生来不讨喜
生来不讨喜 2021-02-03 11:51

I\'d like to send mail without bothering with the SMTP-Server which is used for delivery.

So JavaMail API doesn\'t work for me because I have to specify a SMTP server to

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 12:13

    This is completely the wrong way to handle this.

    Anyone connected to the internet will have some kind of "legit" SMTP server available to them to take the submission of email -- your ISP, your office, etc.

    You WANT to leverage because they do several things for you.

    1) they take your message and the responsibility to handle that message. After you drop it off, it's not your problem anymore.

    2) Any mail de-spamming technologies are handled by the server. Even better, when/if those technologies change (Domain keys anyone?), the server handles it, not your code.

    3) You, as a client of that sending mail system, already have whatever credentials you need to talk to that server. Main SMTP servers are locked down via authentication, IP range, etc.

    4) You're not reinventing the wheel. Leverage the infrastructure you have. Are you writing an application or a mail server? Setting up mail server is an every day task that is typically simple to do. All of those casual "dumb" users on the internet have managed to get email set up.

提交回复
热议问题