How do I send an e-mail in Java?

后端 未结 11 1589
一整个雨季
一整个雨季 2020-12-01 01:55

I need to send e-mails from a servlet running within Tomcat. I\'ll always send to the same recipient with the same subject, but with different contents.

What\'s a sim

11条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 02:34

    Here is the simple Solution

    Download these jars: 1. Javamail 2. smtp 3. Java.mail

    Copy and paste the below code from [http://javapapers.com/core-java/java-email/][1]

    Edit the ToEmail, Username and Password (Gmail User ID and Pwd)

提交回复
热议问题