ericlbarnes / Statamic-email-form

Email form plugin for Statamic
http://ericlbarnes.com/blog/statamic-email-form-plugin
Other
36 stars 6 forks source link

from parameter #19

Closed robsonsobral closed 10 years ago

robsonsobral commented 10 years ago

The from parameter wasn't being used. Please, check its description on the readme. My English is really poor.

aarmitage commented 10 years ago

This update seems to have stopped our more recently added contact forms from working. It could just be our server setup, but we were always getting the 'mail not sent' error, with no logical reason for it and no errors logged on the server.

Eventually we got this working simply by dropping the 5th parameter from the mail function.

return mail($options['to'], $options['subject'], $message, implode("\r\n", $headers));

Also, having spent the last few hours Googling and checking our logs, I can't actually see any examples of the mail function using the flag "-r". So since we changed the flag on the 5th parameter from -r to -f as per other examples I've come across, this also worked.

return mail($options['to'], $options['subject'], $message, implode("\r\n", $headers),"-f".($options['from'] ? $options['from'] : $input['from'] ));

The 5th parameter is optional, so I'd say this commit was specific for a given server environment. In the interest of keeping the plugin as generically suitable as possible, would it be better to remove this additional flag from the master?

robsonsobral commented 10 years ago

Hi!

I spent some time looking for a way to serve us both, but I couldn't.

You're right. The flag should be removed. Do a pull request and, if you don't mind, add a comment about it.

aarmitage commented 10 years ago

Ok - thanks.