KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > mail > SmtpServer


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.mail;
4
5 /**
6  * Represents single SMTP server for sending emails.
7  *
8  * This is part of Jodd.
9  *
10  * todo Default enoding and the rest params
11  * todo Join with POP3?
12  */

13 public class SmtpServer {
14
15     // ---------------------------------------------------------------- construct
16

17     /**
18      * SmtpServer default constructor.
19      */

20     public SmtpServer() {
21     }
22
23     /**
24      * SMTP server defined with its host.
25      *
26      * @param host SMTP host address
27      */

28     public SmtpServer(String JavaDoc host) {
29         this.host = host;
30     }
31
32     /**
33      * SMTP server defined with its host and authenitification.
34      *
35      * @param host SMTP host address
36      */

37     public SmtpServer(String JavaDoc host, String JavaDoc username, String JavaDoc password) {
38         this.host = host;
39         this.username = username;
40         this.password = password;
41     }
42
43     // ---------------------------------------------------------------- data
44

45     private String JavaDoc host;
46     /**
47      * Sets SMTP host address.
48      *
49      * @param host SMTP host address
50      */

51     public void setHost(String JavaDoc host) {
52         this.host = host;
53     }
54     /**
55      * Returns SMTP host address.
56      *
57      * @return SMTP host address
58      */

59     public String JavaDoc getHost() {
60         return host;
61     }
62
63
64     private String JavaDoc username;
65     /**
66      * Sets SMTP authentication username. If username is not set, no
67      * authentification is needed.
68      *
69      * @param username Sets SMTP authentication username.
70      */

71     public void setUsername(String JavaDoc username) {
72         this.username = username;
73     }
74     /**
75      * Returns SMTP authentification username
76      *
77      * @return authentification SMTP username
78      */

79     public String JavaDoc getUsername() {
80         return username;
81     }
82     
83
84     private String JavaDoc password;
85     /**
86      * Sets SMTP authentication password.
87      *
88      * @param password SMTP authentication password
89      */

90     public void setPassword(String JavaDoc password) {
91         this.password = password;
92     }
93     /**
94      * Returns SMTP authentication password.
95      *
96      * @return SMTP authentication password
97      */

98     public String JavaDoc getPassword() {
99         return password;
100     }
101
102 }
103
Popular Tags