JAVA MAIL API. High level representation of the basic components of any mail system. The components are represented by abstract classes in the javax.mail.

Slides:



Advertisements
Similar presentations
Ivan Maurits. Untuk mengirim menggunakan java anda harus memiliki JavaMail API dan Java Activation Framework (JAF) yang telah terinstall dalam komputer.
Advertisements

Topic : JavaMail API (1) Sending and Receiving s Kaster Nurmukan.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
1 Internet Umm Alqura University السنة التحضيرية مهارات الحاسب الالي (1)
The YinYang System. Manager Register/Deregister other Managers Register/Deregister Domains Register/Deregister Active Agents Handle an Agent Service.
TA : Eng.Hala O. Abu Radi.. Nslookup Command SYNOPSIS nslookup [-option... ] [host-to-find | -[server ] ] DESCRIPTION Nslookup is a program to query Internet.
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
The Internet Useful Definitions and Concepts About the Internet.
Layer 7- Application Layer
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
J2EE JavaMail API Presented by Bartosz Sakowicz. Instalation Java Mail API: Java Activation Framework.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
JavaMail JavaMail Classes Sending a Message Using JavaMail (MessageSend.java) Sending a Message to Multiple Recipients (SendToMany.java) Installing JavaMail.
Chapter 30 Electronic Mail Representation & Transfer
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Application Layer Functionality and Protocols Network Fundamentals – Chapter.
CSCI 6962: Server-side Design and Programming Server Created .
2440: 141 Web Site Administration Services Instructor: Enoch E. Damson.
Sending and Receiving s
» Explain the way that electronic mail ( ) works » Configure an client » Identify message components » Create and send messages.
Electronic Mail (SMTP, POP, IMAP, MIME)
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 Application Layer Lecture 5 Imran Ahmed University of Management & Technology.
Rhys McBreen (How the internet works) X. Contents The Layers and what they do IP Addressing X.
Project Four Forms Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule to a Web page.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
Intro to Computer Networks Bob Bradley The University of Tennessee at Martin.
1 Computer Communication & Networks Lecture 27 Application Layer: Electronic mail and FTP Waleed.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 7 The Application Layer.
Internet Applications  DNS   TELNET  FTP  Web browsing.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
 TCP/IP is the communication protocol for the Internet  TCP/IP defines how electronic devices should be connected to the Internet, and how data should.
思科网络技术学院理事会. 1 Application Layer Functionality and Protocols Network Fundamentals – Chapter 3.
WXET1143 Lecture7: , Chat and Messaging. Introduction  Electronic mail is everywhere.  Now many people in business, government, and education use.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
CPT 499 Internet Skills for Educators Electronic Mail Session Five.
Postacademic Interuniversity Course in Information Technology – Module C1p1 Contents Data Communications Applications –File & print serving –Mail –Domain.
How Web Servers and the Internet Work by by: Marshall Brainby: Marshall Brain
Simple Mail Transfer Protocol (SMTP)
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
1 Using Messages sent from machine to machine and stored for later reading. You will use a client to read –Type mail or pine in UNIX to read.
TCP/IP Protocols Dr. Sharon Hall Perkins Applications World Wide Web(HTTP) Presented by.
What is and How Does it Work?  Electronic mail ( ) is the most popular use of the Internet. It is a fast and inexpensive way of sending messages.
Department of Computer Science Southern Illinois University Edwardsville Spring, 2008 Dr. Hiroshi Fujinoki FTP Protocol Programming.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Internet Protocol B Bhupendra Ratha, Lecturer School of Library and Information Science Devi Ahilya University, Indore
1 Chapter 9 – Cookies, Sessions, FTP, and More spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science.
Presented by Rebecca Meinhold But How Does the Internet Work?
CS 3830 Day 9 Introduction 1-1. Announcements r Quiz #2 this Friday r Demo prog1 and prog2 together starting this Wednesday 2: Application Layer 2.
TCP/IP (Transmission Control Protocol / Internet Protocol)
XP New Perspectives on The Internet, Sixth Edition— Comprehensive Tutorial 2 1 Evaluating an Program and a Web-Based Service Basic Communication.
1 E- Mail. 2 Electronic Mail ( ) is simply a means of sending messages via computer Business is using more and fax To access you must.
INTERNET PROTOCOLS. Microsoft’s Internet Information Server Home Page Figure IT2031 UNIT-3.
  is a system of electronic communication that allows the user to exchange messages over the internet  Everyone’s address is unique  Two.
and the business environment Explain what is and how is it used in a business environment A02 .
Project Scenario for OpX. High-level Overview In the Test GUI Controller, opXController, for the opX command there is conceptually a call to an appropriate.
A Quick Look At How Works Understanding the basics of how works can make life a lot easier for any user. Especially those who are interested.
CITA 310 Section 6 Providing Services (Textbook Chapter 8)
4000 Imaje 4020 – Software Imaje 4020 – Content ■ Content of Chapter Software: 1. Flash Up 2. Netcenter 3. FTP 4. Active X 5. XCL commands 6. Exercise.
1 Chapter 10: Application Layer Reference: Chapter 7 - “Computer Networks”, Andrew S. Tanenbaum, 4th Edition, Prentice Hall, 2003.
INTERNET AND . WHAT IS INTERNET The Internet can be defined as the wired or wireless mode of communication through which one can receive, transmit.
© 2010 Computer Science Faculty, Kabul University FTP AND ELECTRONICE MAIL 5 TH LECTURE 4, May, 2010 Baseer Ahmad Baheer.
CIW LESSON 7 PART A. INTRODUCTION TO BUSINESS ELECTRONIC MAIL The use of has given rise to the term ______________________, which is a slang term.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
Sending . Contents A)Sending Mail Using Command Line B)Sending Mail Using GUI.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 9
CIW Lesson 7 Part A Name: _______________________________________
Configuring Internet-related services
Message Passing Systems Version 2
Message Passing Systems
Presentation transcript:

JAVA MAIL API

High level representation of the basic components of any mail system. The components are represented by abstract classes in the javax.mail package. These classes are all abstract because they don’t make many assumptions about how the is stored or transferred between machines.

JavaMail API is a standard extension to Java, not part of the core JDK or JRE class library. Consequently there’ll need to download it separately from Sun. Download “mail.jar”. This file contains the actual.class file that implement the JavaMail API. Add this file to the class path OR simply place it in jre/lib/ext directory.

Java Mail API uses JavaBeans Activation Framework(JAF) to describe and display multilingual text and encoded multimedia data. The JavaBeans Activation Framework is also a standard extension to Java, not part of the core API. Download “activation.jar” file and place it in the class path.

Sending 1.Set the “mail.host” property to point the local mail server- Properties props = new Properties() props.put("mail.host",“ "); It can be like:: alt2.gmail-smtp-in.l.google.com

How to know about mail server Open a DOS Command Prompt Type "nslookup". Your computer's DNS Server name and IP address will be displayed. Type "set type=mx" This will cause NSLOOKUP to only return what are known as MX (Mail eXchange) records from the DNS servers.

Step 2 These properties are used to retrieve a Session object from the Session.getInstance() method like this- Session mailConnection = Session.getInstance(props,null); Session object represents an ongoing communication between a program and one mail server. The second argument to the getInstance(), null here is a javax.mail.Authenticator that ask the user for a password if requested by the server.

Step 3 Session object is used to create a new Message object- Message msg=new MimeMessage(mailConnection); MimeMessage is used to send Internet .

Step 4 Set up from address and to address- Address fromMy=new ay Address toMy= new

Step 5 Set up from header- Msg.setFrom(fromMy);

Step 6 Set up the To header- Not only specify the address that the message will be sent to but how that address is used i.e. TO, Cc, or Bcc. This is done by Message.RecipientType.TO Message.RecipientType.CC Message.RecipientType.BCC Set the to header- Msg.setRecipient(Message.RecipientType.TO, toMy);

Step 7 Set message subject- Msg.setSubject(“This is Subject Line”);

Step 8 Set up the content of message- msg.setContent(“TextTextText”, “text/plain”);

Step 9 Send the message- Transport.send(msg); Example to Send

Receiving Mail