EMAIL: Difference between revisions
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category: Middleware4j]] | |||
=EMAIL Map Configuration= | =EMAIL Map Configuration= | ||
'''config.xml''' | '''config.xml''' | ||
<syntaxhighlight lang="xml"> | |||
<map> | |||
<id>Map05</id> | |||
<enabled>true</enabled> | |||
<description>Send File via Email</description> | |||
<enableEmailNotifications>true</enableEmailNotifications> | |||
<connectors> | |||
<input> | |||
<id>in1</id> | |||
<description>Read File</description> | |||
<type>EMAIL</type> | |||
<url> | |||
< | <path>./interface/input/Map05 File to EMAIL</path> | ||
<mask/> | |||
<prefix/> | |||
<pollingInterval>1000</pollingInterval> | |||
</url> | |||
</input> | |||
<output> | |||
<id>out1</id> | |||
<enabled>true</enabled> | |||
<description>Email File</description> | |||
<type>EMAIL</type> | |||
<url> | |||
<path>./interface/output/Map05 File to EMAIL</path> | |||
<prefix/> | |||
<fileExtension/> | |||
<use83GUID>false</use83GUID> | |||
</url> | |||
<email> | |||
<emailListID>Excel</emailListID> | |||
<subject>Test Email</subject> | |||
<message>See Attached File</message> | |||
</email> | |||
</output> | |||
</connectors> | |||
</map> | |||
</syntaxhighlight> | |||
The email connector provides an automated method of sending files via email. It's currently a "send only" connector so it does not have the ability to check for incomming emails. | The email connector provides an automated method of sending files via email. It's currently a "send only" connector so it does not have the ability to check for incomming emails. | ||
If we look at the example configuration above we can see that both the input and output types are defined as | If we look at the example configuration above we can see that both the input and output types are defined as | ||
<syntaxhighlight lang="xml"> | |||
<type>EMAIL</type> | <type>EMAIL</type> | ||
</syntaxhighlight> | |||
The way the system works is that you specify a folder and file type (mask) that you want to detect on the input connector side and the destination / subject / message on the output side. | The way the system works is that you specify a folder and file type (mask) that you want to detect on the input connector side and the destination / subject / message on the output side. | ||
Rather than putting email addresses in the middleware config directly the output map lets you specify a distribution list | Rather than putting email addresses in the middleware config directly the output map lets you specify a distribution list | ||
<syntaxhighlight lang="xml"> | |||
<emailListID>PDF</emailListID> | <emailListID>PDF</emailListID> | ||
</syntaxhighlight> | |||
The email addressed associated with the emailListID are held in the email.xml configuration file. See [[Email Configuration]] for additional information on this file. | The email addressed associated with the emailListID are held in the email.xml configuration file. See [[Email Configuration]] for additional information on this file. | ||
=EMAIL Settings= | =EMAIL Settings= | ||
'''email.xml''' | '''email.xml''' | ||
<syntaxhighlight lang="xml"> | |||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<emailSettings> | <emailSettings> | ||
Line 56: | Line 85: | ||
</distributionList> | </distributionList> | ||
</emailSettings> | </emailSettings> | ||
</syntaxhighlight> | |||
You will see there are several '''distributionList''' entries above and you can create new ones if you want. Each section has the following attributes. | You will see there are several '''distributionList''' entries above and you can create new ones if you want. Each section has the following attributes. | ||
Line 87: | Line 117: | ||
=Example Email Settings= | =Example Email Settings= | ||
===SMTP No Authentication Example=== | |||
<syntaxhighlight lang="xml"> | |||
<configuration> | <configuration> | ||
<property name="mail.smtp.starttls.enable" value="false"/> | <property name="mail.smtp.starttls.enable" value="false"/> | ||
Line 100: | Line 132: | ||
<property name="mail.debug" value="true"/> | <property name="mail.debug" value="true"/> | ||
</configuration> | </configuration> | ||
</syntaxhighlight> | |||
===Microsoft smtp.live.com Example=== | |||
<syntaxhighlight lang="xml"> | |||
<configuration0> | <configuration0> | ||
<property name="mail.smtp.auth" value="true"/> | <property name="mail.smtp.auth" value="true"/> | ||
Line 116: | Line 149: | ||
<property name="mail.debug" value="true"/> | <property name="mail.debug" value="true"/> | ||
</configuration0> | </configuration0> | ||
</syntaxhighlight> | |||
===Google gmail Example=== | |||
<syntaxhighlight lang="xml"> | |||
<configuration1> | <configuration1> | ||
<property name="mail.smtp.auth" value="true"/> | <property name="mail.smtp.auth" value="true"/> | ||
Line 131: | Line 166: | ||
<property name="mail.debug" value="true"/> | <property name="mail.debug" value="true"/> | ||
</configuration1> | </configuration1> | ||
</syntaxhighlight> |
Latest revision as of 15:33, 30 December 2024
EMAIL Map Configuration
config.xml
<map>
<id>Map05</id>
<enabled>true</enabled>
<description>Send File via Email</description>
<enableEmailNotifications>true</enableEmailNotifications>
<connectors>
<input>
<id>in1</id>
<description>Read File</description>
<type>EMAIL</type>
<url>
<path>./interface/input/Map05 File to EMAIL</path>
<mask/>
<prefix/>
<pollingInterval>1000</pollingInterval>
</url>
</input>
<output>
<id>out1</id>
<enabled>true</enabled>
<description>Email File</description>
<type>EMAIL</type>
<url>
<path>./interface/output/Map05 File to EMAIL</path>
<prefix/>
<fileExtension/>
<use83GUID>false</use83GUID>
</url>
<email>
<emailListID>Excel</emailListID>
<subject>Test Email</subject>
<message>See Attached File</message>
</email>
</output>
</connectors>
</map>
The email connector provides an automated method of sending files via email. It's currently a "send only" connector so it does not have the ability to check for incomming emails.
If we look at the example configuration above we can see that both the input and output types are defined as
<type>EMAIL</type>
The way the system works is that you specify a folder and file type (mask) that you want to detect on the input connector side and the destination / subject / message on the output side.
Rather than putting email addresses in the middleware config directly the output map lets you specify a distribution list
<emailListID>PDF</emailListID>
The email addressed associated with the emailListID are held in the email.xml configuration file. See Email Configuration for additional information on this file.
EMAIL Settings
email.xml
<?xml version="1.0" encoding="UTF-8"?>
<emailSettings>
<configuration>
<property name="mail.smtp.auth" value="true"/>
<property name="mail.smtp.starttls.enable" value="true"/>
<property name="mail.smtp.host" value="smtp.gmail.com"/>
<property name="mail.smtp.socketFactory.port" value="465"/>
<property name="mail.smtp.user" value="dummy@gmail.com"/>
<property name="mail.smtp.password" value="mycomplexpassword"/>
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
<property name="mail.smtp.auth" value="true"/>
<property name="mail.smtp.port" value="465"/>
<property name="mail.smtp.from" value="dummy@gmail.com"/>
</configuration>
<distributionList id="Monitor" enabled="Y" maxFrequencyMins="0">
<toAddressList>dummy@gmail.com</toAddressList>
</distributionList>
<distributionList id="Error" enabled="Y" maxFrequencyMins="5">
<toAddressList>dummy@gmail.com</toAddressList>
</distributionList>
<distributionList id="Excel" enabled="Y" maxFrequencyMins="5">
<toAddressList>dummy@gmail.com</toAddressList>
</distributionList>
<distributionList id="PDF" enabled="Y" maxFrequencyMins="5">
<toAddressList>dummy@gmail.com</toAddressList>
</distributionList>
</emailSettings>
You will see there are several distributionList entries above and you can create new ones if you want. Each section has the following attributes.
Some of these lists have a "standard" purpose and should not be deleted or renamed.
Monitor is used to send daily statistics on the number of messages processed. It will also email you to say if the Middleware service stops or starts.
Error - as it's name suggests will inform you of any errors encountered, such as a network share becoming unavailable.
Distribution List Settings
Element | Value | Description |
---|---|---|
id | id | A identification which can be used in a mapping file. The email.xml can have multiple distribution lists but each one must have a unique id. |
description | string | Meaningful description of what the distribution list is for. |
enabled | Y or N | A simple way to disable or enable a list. |
maxFrequencyMins | nnn | Number of minutes between identical emails. This can prevent or limit the number of emails which can be sent due to a persistent error condition. |
toAddressList | Email addresses separated with a comma |
Example Email Settings
SMTP No Authentication Example
<configuration>
<property name="mail.smtp.starttls.enable" value="false"/>
<property name="mail.smtp.host" value="smtp.demo.com"/>
<property name="mail.smtp.socketFactory.port" value="25"/>
<property name="mail.smtp.user" value="demo@email.com"/>
<property name="mail.smtp.password" value=""/>
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
<property name="mail.smtp.auth" value="false"/>
<property name="mail.smtp.port" value="25"/>
<property name="mail.smtp.from" value="demo@email.com"/>
<property name="mail.debug" value="true"/>
</configuration>
Microsoft smtp.live.com Example
<configuration0>
<property name="mail.smtp.auth" value="true"/>
<property name="mail.smtp.starttls.enable" value="true"/>
<property name="mail.smtp.host" value="smtp.live.com"/>
<property name="mail.smtp.socketFactory.port" value="25"/>
<property name="mail.smtp.user" value="email@outlook.com"/>
<property name="mail.smtp.password" value="mycomplexpassword"/>
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
<property name="mail.smtp.auth" value="true"/>
<property name="mail.smtp.port" value="25"/>
<property name="mail.smtp.from" value="email@outlook.com"/>
<property name="mail.debug" value="true"/>
</configuration0>
Google gmail Example
<configuration1>
<property name="mail.smtp.auth" value="true"/>
<property name="mail.smtp.starttls.enable" value="true"/>
<property name="mail.smtp.host" value="smtp.gmail.com"/>
<property name="mail.smtp.socketFactory.port" value="465"/>
<property name="mail.smtp.user" value="email@gmail.com"/>
<property name="mail.smtp.password" value="mycomplexpassword"/>
<property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>
<property name="mail.smtp.auth" value="true"/>
<property name="mail.smtp.port" value="465"/>
<property name="mail.smtp.from" value="email@gmail.com"/>
<property name="mail.debug" value="true"/>
</configuration1>