Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Programming 10- SMTP-POP3

Similar presentations


Presentation on theme: "Network Programming 10- SMTP-POP3"— Presentation transcript:

1 Network Programming 10- SMTP-POP3 Hariandi Maulid, S.T., M.Sc – Informatics Engineering- School of Applied Science,Telkom University

2 The SMtp Short for Simple Mail Transfer Protocol, a protocol for sending e- mail messages between servers. Most systems that send mail over the Internet use SMTP to send messages from one server to another; the messages can then be retrieved with an client using either POP or IMAP. In addition, SMTP is generally used to send messages from a mail client to a mail server. This is why you need to specify both the POP or IMAP server and the SMTP server when you configure your application. SMTP by default uses TCP port 25. The protocol for mail submission is the same, but uses port 587. SMTP connections secured by SSL, known as SMTPS, default to port 465 (nonstandard, but sometimes used for legacy reasons).

3

4 SMtp transport example
A typical example of sending a message via SMTP to two mailboxes (alice and the boss) located in the same mail domain example.com or localhost.com) is reproduced in the following session exchange. (In this example, the conversation parts are prefixed with S: Server and C: Client) After the message sender (SMTP client) establishes a reliable communications channel to the message receiver (SMTP server), the session is opened with a greeting by the server, usually containing its Fully Qualified Domain Name (FQDN), in this case smtp.example.com. The client initiates its dialog by responding with a HELLO command identifying itself in the command’s parameter with its FQDN.

5

6

7 SMTP Reply Codes

8 The mail server installation
Download the mail server from Afer successfull installation: 1. Create a domain ex: netpro.com 2. Create 2 (two) users : and

9 Creating a domain Creating 2 users

10 Installing email client
Download Mozilla Thunderbird from US/thunderbird/ After Successfull installation: Create new account

11

12

13 Now you can send (write) and receive (read) message between user1 and user 2

14 Sending email with java socket
In the previous step, we have installed hmail server in our localhost( ). This mail server can be used as a target host/server for our java socket program to send . Here is the code for connecting to the server. Sttring host: “ ” int port =25; Socket socket= new Socket (host, port); The complete code can be obtained in the next page

15 The sending mail code

16

17

18 The result

19 Check The result in thunderbird

20 Imap and pop3 IMAP IMAP stands for Internet Message Access Protocol. IMAP shares many similar features with POP3. It, too, is a protocol that an client can use to download from an server. However, IMAP includes many more features than POP3. The IMAP protocol is designed to let users keep their on the server. IMAP requires more disk space on the server and more CPU resources than POP3, as all s are stored on the server. IMAP normally uses port 143.

21 Imap and pop3 (2) POP3 POP3 stands for Post Office Protocol. POP3 allows an client to download an from an server. The POP3 protocol is simple and does not offer many features except for download. Its design assumes that the client downloads all available from the server, deletes them from the server and then disconnects. POP3 normally uses port 110.

22 IMAP vs POP3 POP3 and IMAP are two different protocols (methods) used to access . Of the two, IMAP is the better option - and the recommended option - when you need to check your s from multiple devices, such as a work laptop, a home computer, or a tablet, smartphone, or other mobile device. Tap into your synced (updated) account from any device with IMAP. POP3 downloads from a server to a single computer, then deletes it from the server. Because your messages get downloaded to a single computer or device and then deleted from the server, it can appear that mail is missing or disappearing from your Inbox if you try to check your mail from a different computer.

23 IMAP vs POP3 (2)

24 POP3 with Java String host= “127.0.0.1”; int port= 110;
Socket socket= new Socket (host, port); Send User wr.write (“USER \r\n”); Send Password wr.write (“PASS user1 \r\n”);

25 The message to be retrieved

26 The pop3 code

27

28

29

30 The result


Download ppt "Network Programming 10- SMTP-POP3"

Similar presentations


Ads by Google