Mail Daemon

«« Back
Task

Create mail sending utility with configurable settings.

Configuration
App.config
Change MailProfile value to use a suitable mail configuration. <add key="MailProfile" value="mailSettings_Default.json" />
Folders
MailProfiles – folder to store JSON mail profiles.
MailTemplates – folder to store mail templates.

mailSettings_Default.json
{
    "sender":
    {
        "address": "<mail address>",
        "name": "<name>"
    },
    "subject": "<subject>",
    "template": "<path to mail template>",
    "attachments": [
        {
            "path": "<path to file>",
            "filename": "<file name>"
        }
    ],
    "recipients": [
        {
            "address": "<mail address>",
            "name": "<name>",
            "subject": "<subject override parent>",
            "company": "<company>"
            "template": "<path to mail template override parent>"
            "attachments": [
                {
                    "path": "<path to file>",
                    "filename": "<file name>"
                }
            ],
        }
    ]
}

Text placeholders
{PERSON_NAME} – recipient name.
{COMPANY_NAME} – recipient company name.

Validation mode
Run Mail Daemon with attribute -v to validate JSON mail profile: no any mail sending, just validation. MailDaemon.exe -v
Run Mail Daemon with attributes -v -d to validate JSON mail profile: no any recipient mail sending, just validation and sending demo mail to sender address. MailDaemon.exe -v -d
Mail Daemon validation

Source code: http://sd.blackball.lv/job/tests/MailDaemon/MailDaemon-source.zip