|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.frame4j.util.App
de.frame4j.SendMail
@MinDoc(copyright="Copyright 2002 - 2004 , 2009 A. Weinert",
author="Albrecht Weinert",
version="V.38",
lastModified="10.04.2010",
lastModifiedBy="A. Weinert",
usage="start as Java application (-? for help)",
purpose="a tiny E-mail sender (command line controlled)")
public class SendMail
A tiny E-Mail sender.
This application is a tiny command line controlled SMTP-Client using the
JavaMail API (javax.mail).
On a successful execution this application send a plain text e-mail
(BodyPart) and / or one or more file attachments
(Multipart) to one or more addressees.
By start arguments, by an extra .properties file or by an RFC822 e-mail
definition file among others the following mail properties may be
specified:
From : the cheap provider <dev.executive@sioux.tv> To : the customer <dear.customer@customers-ltd.tv> Reply-To: call centre <pontius.pilatus@sioux.tv> Subject : You are disconnected after your Western Union payment This mail was only send to you to keep you calm. You should get the impression your error report is taken seriously and the repair is under way. But this is just an automated response by a clever computer programme. Thank you for your endless patience.On such RFC822 mail definitions the very first empty line is the separation of the header definitions from the (optional) mail text.
SendMail in the anonymous package.# Property-File for SendMail.java (jdk\jre\lib\SendMail.properties) # V1.0 (So, 04.04.2010, 21:57 MEZ) # for location / server: @ home # A. Weinert changes for 1&1 # mail.from= no.reply@frame4j.de mail.smtp.host = smtp.1und1.de userName= ano.reply@frame4j.de # use the next line if you like it here more than in the command line # userPass=monRepos proxySet = false mail.smtp.auth = true # if behind a proxy say: # proxySet = true # proxyHost = myCompany'sProxy # proxyPort = 8080
InternetAddress,
MimeMessage| Field Summary | |
|---|---|
String |
attach
First attachment file. |
String |
bcc
The secret copy recipient(s) (may be a list). |
String |
cc
The copy recipient(s) (may be a list). |
String |
contFile
The content file. |
String |
contFileEncoding
File encoding for content file. |
int |
contLogLength
Log length of content. |
boolean |
parse
The file is not only the content. |
String |
proxyHost
The proxy server's name. |
String |
proxyPort
The proxy server's port. |
boolean |
proxySet
Use a proxy server connecting to mail host. |
String |
subject
The subject. |
String |
text
The content. |
String |
timeFormat
Format for time stamp. |
boolean |
timeStamp
Set actual time stamp. |
String |
to
The recipient(s) (may be a list). |
String |
userName
|
String |
userPass
|
| Fields inherited from class de.frame4j.util.App |
|---|
ano, appBase, appIO, appStartTime, args, bgColor, err, fullClassName, help, icon, INIT_ERROR, jmxRemoteNote, JOB_DONE_OK, log, LOG_OUT_ERROR, MAIN_THREAD_EXC, mainThread, myClass, myFrame, name, NO_PARS_ERROR, objectName, out, outMode, packName, prop, retCode, runFlag, shortClassName, title, verbose, verbosity |
| Fields inherited from interface de.frame4j.net.AttrSettable |
|---|
ILLEGAL_TYPE, ILLEGAL_VALUE, NO_ATTRIBUTE, NO_KNOWN_ATTRIBUTE, NO_VALUE, OK |
| Constructor Summary | |
|---|---|
SendMail()
|
|
| Method Summary | |
|---|---|
int |
doIt()
Working method of SendMail. |
static void |
main(String[] args)
Start method of SendMail. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int contLogLength
App.verbose is true the mail content will be logged, but
truncated in the log output after a maximum of contLogLength
characters. The truncation does not happen if contLogLength is
<= 42. If the mail text is truncated in the log, that will
be signalled by dots ( ....).
public String to
parseed RFC 822 definition file contFile that
will be added to the addressees defined in the parsed file.
public String cc
to property apply.
public String bcc
to property apply.
public String subject
public boolean timeStamp
toRFCString(),
toGMTString()public String timeFormat
timeStamp is true, this format will be used for the mails's
date (header) field.
ConstTime.toString(CharSequence)public String text
contFile) read.
public String contFile
contFile is not empty, it is tried to read the mail's text
content directly from there respectively to parse the whole
RFC822 mail definition from it.contFile may denote a file or an URL.
public boolean parse
parse is true the file or URL denoted by contFile
will not be taken for content only, but parsed as whole RFC 822 mail
definition.
public String contFileEncoding
contFile is not empty, it is tried to read the mail's text
content directly from there respectively to parse the whole
RFC822 mail definition from it.contFileEncoding will be used for that file or
URL.
public String attach
attach is nor empty it is tried to add the file denoted by
it as a true attachment to the mail.
public String userName
public String userPass
public boolean proxySet
proxyHost and proxyHost are in effect.
public String proxyHost
proxySetpublic String proxyPort
proxySet| Constructor Detail |
|---|
public SendMail()
| Method Detail |
|---|
public static void main(String[] args)
args - command line parameterdoIt(),
App.go(String[], boolean)public int doIt()
doIt in class Appmain(Strin[]),
App.go(String[], boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||