Package com.jk.core.mail
Class JKMailInfo
java.lang.Object
com.jk.core.mail.JKMailInfo
This class provides the necessary method and attributes needed for the
JKMailInfo
objects- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttachment
(Attachment attachment) This method adds an attachment to the collection of attachments to this mail.void
fillEmail
(org.apache.commons.mail.MultiPartEmail email) This method fills the data from the providedMultiPartEmail
into thisJKMailInfo
object.getBcc()
This method gets this mail BCC.getCc()
This method gets this mail CC.getFrom()
This method gets who the sender of the mail is.getHost()
This method gets the host.getMsg()
This method gets the message.int
This method gets the SMTP port.This method gets the mail subject.getTo()
This method gets the receiver of the mail.This method gets the user name.boolean
This method checks whether the mail requires authentication or not.boolean
This method check whether this mail is secured or not.void
This method sets the mail BCC to the provided value.void
This method sets the mail CC to the provided value.void
This method sets the sender to the provided value.void
This method sets the host to the provided value.void
This method sets the mail message to the provided value.void
setPassword
(String password) This method sets the password to the specified value.void
setRequiresAuthentication
(boolean requiresAuthentication) This method specify whether this mail requires authentication or not.void
setSecured
(boolean secured) This method specify whether this mail is secure or not.void
setSmtpPort
(int smtpPort) This method sets the SMTP port to the provided value.void
setSubject
(String subject) This method sets the mail subject to the provided value.void
This method sets the mail receiver to the provided value.void
setUsername
(String username) This method sets the user name to the provided value.
-
Constructor Details
-
JKMailInfo
public JKMailInfo()
-
-
Method Details
-
addAttachment
This method adds an attachment to the collection of attachments to this mail.- Parameters:
attachment
- Specifies the attachment to be added.
-
fillEmail
public void fillEmail(org.apache.commons.mail.MultiPartEmail email) throws org.apache.commons.mail.EmailException, IOException This method fills the data from the providedMultiPartEmail
into thisJKMailInfo
object.This method changes the host name, SMTP port, SSL SMTP port, receiver, sender, subject, message, BCC, CC and whether this mail is secured, requires Authentication or not.
- Parameters:
email
- Specifies the email information to be replaced in thisJKMailInfo
object.- Throws:
org.apache.commons.mail.EmailException
- if a checked error occurs in commons-email.IOException
- if an I/O exception has occurred.
-
getSmtpPort
public int getSmtpPort()This method gets the SMTP port.- Returns:
- the SMTP port.
-
setSmtpPort
public void setSmtpPort(int smtpPort) This method sets the SMTP port to the provided value.- Parameters:
smtpPort
- Specifies the new SMTP port.
-
isRequiresAuthentication
public boolean isRequiresAuthentication()This method checks whether the mail requires authentication or not.- Returns:
- true, if it requires authentication, false otherwise.
-
setRequiresAuthentication
public void setRequiresAuthentication(boolean requiresAuthentication) This method specify whether this mail requires authentication or not.- Parameters:
requiresAuthentication
- Specifies whether this mail requires authentication or not.
-
getUsername
This method gets the user name.- Returns:
- the user name.
-
setUsername
This method sets the user name to the provided value.- Parameters:
username
- Specifies the new user name.
-
setPassword
This method sets the password to the specified value.- Parameters:
password
- Specifies the new password.
-
getFrom
This method gets who the sender of the mail is.- Returns:
- the sender of the mail.
-
getHost
This method gets the host.- Returns:
- the host.
-
getMsg
This method gets the message.- Returns:
- the message.
-
getSubject
This method gets the mail subject.- Returns:
- the mail subject.
-
getTo
This method gets the receiver of the mail.- Returns:
- the receiver of the mail.
-
setFrom
This method sets the sender to the provided value.- Parameters:
from
- Specifies the new sender.
-
setHost
This method sets the host to the provided value.- Parameters:
host
- Specifies the new host.
-
setMsg
This method sets the mail message to the provided value.- Parameters:
msg
- Specifies the new mail message.
-
setSubject
This method sets the mail subject to the provided value.- Parameters:
subject
- Specifies the new subject.
-
setTo
This method sets the mail receiver to the provided value.- Parameters:
to
- Specifies the new receiver.
-
isSecured
public boolean isSecured()This method check whether this mail is secured or not.- Returns:
- true, if is secured, false otherwise.
-
setSecured
public void setSecured(boolean secured) This method specify whether this mail is secure or not.- Parameters:
secured
- Specify whether this mail is secure or not.
-
getCc
This method gets this mail CC.- Returns:
- the mail CC.
-
setCc
This method sets the mail CC to the provided value.- Parameters:
cc
- Specifies the new mail CC.
-
getBcc
This method gets this mail BCC.- Returns:
- the mail BCC.
-
setBcc
This method sets the mail BCC to the provided value.- Parameters:
bcc
- Specifies the new mail BCC.
-