Dancer::Plugin::Email is a Perl module that provides an easy way of handling text or html email messages with or without attachments. Simply define how you wish to send the email in your application's YAML configuration file, then call the email keyword passing the necessary parameters as outlined above.
SYNOPSIS
use Dancer;
use Dancer::Plugin::Email;
post '/contact' => sub {
email {
to => '...',
subject => '...',
message => $msg,
attach => [ '/path/to/file' ]
};
};
Important Note! The default email format is plain-text, this can be changed to html by setting the option 'type' to 'html' in the config file or as an argument in the hashref passed to the email keyword. The following are options that can be passed to the email function:
# send message to
to => $email_recipient
# send messages from
from => $mail_sender
# email subject
subject => 'email subject line'
# message body
message => 'html or plain-text data'
message => {
text => $text_message,
html => $html_messase,
# type must be 'multi'
}
# email message content type
type => 'text'
type => 'html'
type => 'multi'
# carbon-copy other email addresses
cc => 'user@site.com'
cc => 'user_a@site.com, user_b@site.com, user_c@site.com'
cc => join ', ', @email_addresses
# blind carbon-copy other email addresses
bcc => 'user@site.com'
bcc => 'user_a@site.com, user_b@site.com, user_c@site.com'
bcc => join ', ', @email_addresses
# specify where email responses should be directed
reply_to => 'other_email@website.com'
# attach files to the email
attach => [ '/path/to/file1', '/path/to/file2' ]
# send additional (specialized) headers
headers => {
"X-Mailer" => "Dancer::Plugin::Email 1.23456789"
}
Product's homepage
Requirements:
· Perl