Summary of JavaMail operations (1)

xiaoxiao2021-03-06  99

When I finalize the netizen's article, I found a Javamail's summary. I would like to thank the_east_key, and I will announce it to everyone, I hope to help everyone, the full text is as follows: This article is: send ordinary mail, accept ordinary mail to send a mail with attachment Receive messages that receive an accessory to send an HTML form, accept the message of the HTML [B [send mail [/ b] with pictures to make a summary. Import java.awt. *; import java.awt.event. *; import javax.swing. *; import com.borland.jbcl.layout. *; import javax.mail. *; import java.util. *; Import Javax .mail.internet. *; import java.io. *; import javax.activation. *; public string host = "smtp.163.com"; public string username = "abcDefg"; public string password = "abcdefg"; public String mail_head_name = "this is head of this mail"; public String mail_head_value = "this is head of this mail"; public String mail_to = "xyz@163.com"; public String mail_from = "abcdefg@163.com"; public String mail_subject = "this is the subject of this test mail"; public String mail_body = "this is the mail_body of this test mail"; // this code is used to send the usual mail void jButton1_actionPerformed (ActionEvent e) {try {Properties PrOPS = New Properties (); // Get System Environment Authenticator Auth = New Email_Autherticator (); // Perform mail server user authentication Props.PUT ("mail.smtp.host", host); prOPs.put ("mail.smtp .auth "," true "); session session = session.getDefaultInstance (PROPS, AUTH); // Set the session, and mail servers for communication.

转载请注明原文地址:https://www.9cbs.com/read-126871.html

New Post(0)