I am using a user defined form that is used as a contact form. Unfortunately when the mail arrives it has no "from" so it goes into junk how do I make the email have a from field.
Thanks
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I am using a user defined form that is used as a contact form. Unfortunately when the mail arrives it has no "from" so it goes into junk how do I make the email have a from field.
Thanks
That indeed is a problem and I filed it as a bug for the devs (here).
However, if you're a bit into SS, you could patch (or even better: subclass) UserDefinedForm.php by adding this line:
$email->setFrom(yourDefaultFrom@emailaddress.com);
If you decide to patch, it should be placed somewhere around line 390.
If you decide to subclass, this line is part of the process-function.
Off course it would be nice if you would be able to replace 'yourDefaultFrom@emailadres.com' by the e-mailadres the user has entered. However, I still don't know how to accomplish that.
Maybe there is a dev somewhere around who could give us a hint?