JavaMail access Hotmail mailbox _ MySQL

Source: Internet
Author: User
Tags imap
I believe many people have MSN chat tools account, such as abc@hotmail.com, this account is actually a mail address, can be normal mail sending and receiving function, you can access and operate this mailbox through www.hotmail.com for sending and receiving emails. However, this mailbox does not provide POP3 or SMTP services, that is, JavaMailHotmail.

I believe many people have MSN chat tools account, such as abc@hotmail.com, this account is actually a mail address, can be normal mail sending and receiving function, you can access and operate this mailbox through the Web site http://www.hotmail.com for mail sending and receiving. However, this mailbox has a restriction that it does not provide POP3 or SMTP services. that is to say, this mailbox cannot be used by common mail client tools. although many mail tools currently support Hotmail, however, if we need to add support for Hotmail in our Java project, we often do not know where to start, because the JavaMail provided by SUN does not support POP3, IMAP, and SMTP protocols.

But in fact, JavaMail only defines a set of mail program frameworks that are platform-independent and independent from communication protocols, or interfaces. it exists as an optional Java package. So it can be said that JavaMail does not care about the protocols used, whether it is POP3, SMTP, IMAP, or the HTTP protocol used by Hotmail. This is also true for the JavaMail client. it is the simplest JavaMail structure. it sends emails through Transport and collects emails through Store. different protocols are implemented, the concept in JavaMail is Provider. you only need to implement your own Provider according to the interface defined by JavaMail.


To access Hotmail via JavaMail, we need to build a bridge between the JavaMail interface and the access interface provided by the Hotmail service. Before that, we must first understand the interface protocol used by Hotmail.

Hotmail provides HTTP-based services through the address http://services.msn.com/svcs/hotmail/httpmail.asp, which is different from the address where we access the http://www.hotmail.com through a browser, the following address provides a browser-based access interface for you to operate on your mailbox. of course, you can write an HTTP client program to parse the page and obtain mail information, however, this not only achieves a very high degree of complexity, but also requires corresponding adjustments to the program after each page style change. Therefore, it is not universal and obviously not feasible. Unlike address http://services.msn.com/svcs/hotmail/httpmail.asp, it provides a fixed application interface. When you use a browser to access this address, the following logon request form is displayed:

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.