Add the class I use javamail smtp

Source: Internet
Author: User
Example:
/*
* New sendmail () uses the default GBK encoding to send text information.
* New sendmail (encoding, text or html );
*/
Wuyu. javamail. sendmail mail = new wuyu. javamail. sendmail ("GBK", true );
/*
* Mail. connect (smtp server );
* Main. connect (smtp server, user name, password); applicable to smtp-authenticated mail servers
*/
Mail. connect (args [0], args [1], args [2]);
For (int I = 0; I <Integer. parseInt (args [3]); I ++ ){
System. out. print (I + "");
/*
* Main. send (from, to, cc, bcc, topic, body, attachment file name)
* To, cc, and bcc can be filled with multiple mail addresses
* If the attachment file name is null, no attachment is sent.
*/
Mail. send ("mmwy@ynwst.com", args [4], "", "", "This is the topic" + I, "<B> This is the body </B>", null );
System. out. println (I );
        }
Mail. close ();
=-= --------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.