Closed xatx1 closed 11 years ago
You can view the documentation here https://metacpan.org/module/Dancer::Plugin::Email . There are configuration examples there.
I had noted the example
Example configuration for sending mail via Gmail: plugins: Email: transport: SMTP: ssl: 1 host: 'smtp.gmail.com' port: 465 sasl_username: 'bob@gmail.com' sasl_password: 'secret'
Where do I write the information? I know those information should be in a configuration file, Do you mean to write it into config.yml file or other places? assuming that my program is under d:\dancer\my.pl. where can I find the configuration head file and write the information into it?
Yes, you can put it in your config.yml
When I write the information into config.yml It shows the conflict with port with dancer itself. It just turns the port into 127.0.0.1:465 Can someone show a concrete example how to set up the plugin please?
In the place of CONFIGURATION: "You may also provide default headers in the configuration:", what does the configuration mean? Is the configuration a file or a header information in my.pl program? Do really appropriate if someone can illustrate the usage of plugin of email.
The examples here are concrete examples: https://metacpan.org/module/Dancer::Plugin::Email#CONFIGURATION The reason you have a conflict with the dancer port is most likely because you did not correctly indent the lines in your config.yml file. Notice that the lines in the examples are indented. The YAML file format requires correct indentation. You should research a little about YAML.
"You may also provide default headers in the configuration:" means the config.yml file. And immediately after that, there is an example.
Do really appriciate you help. I have find alternative solution and still I will try your suggestion. I think you have pointed out the keys points and you can close my ticket. Thank you for you patience.
Dear All I'm a beginner of Dancer and I'm using it for work . I do need a email function and I turn to Dancer plugin:email and find it's attractive. However I have no idea about the concept of configuration(Where is the configuration file and how can I connect it with my Perl program ) since my computer doesn't have SMTP.
I intend to use my company email account to send a attachment with a brief description. Let start it with a example
use Dancer; use Dancer::Plugin::Email;
post '/contact' => sub { email { from => 'bob@foo.com', to => 'sue@foo.com', subject => 'allo', body => 'Dear Sue, ...', attach => '/path/to/attachment', }; }; start;
Suppose the account name is:bob password is :123456 SMTP address is :10.7.1.21 (or smtp.foo.com) and port is :25 How can I make it work? If there is a available example, can you give me a link so I can to study