Default Email From Address
Permalink
Hi, having some trouble getting a change to the default email from address to take. I've added the below to config/site.php:
define('EMAIL_DEFAULT_FROM_ADDRESS', 'XXXXXXXXXXXXXXX');
define('EMAIL_DEFAULT_FROM_NAME', 'XXXXXXXXXXXX');
define('FORM_BLOCK_SENDER_EMAIL', EMAIL_DEFAULT_FROM_ADDRESS);
With Xs swapped out for real data. However, when submitting a forgotten password request the email is still coming from the site admin email address.
If I add the below line into public_html/concrete/mail/forgot_password.php
$from = array(EMAIL_DEFAULT_FROM_ADDRESS, EMAIL_DEFAULT_FROM_NAME);
Then it works fine.
I notice public_html/concrete/core/helpers/mail.php has this code in it:
if (!isset($from)) {
$from = array(EMAIL_DEFAULT_FROM_ADDRESS, EMAIL_DEFAULT_FROM_NAME);
$fromStr = EMAIL_DEFAULT_FROM_ADDRESS;
}
which I would have expected to pick up my values set in site.php without having to enter the $from line in forgot_password.php
Any ideas why the values in site.php aren't being picked up?
C5 version is 5.6.0.2
Cheers, James
define('EMAIL_DEFAULT_FROM_ADDRESS', 'XXXXXXXXXXXXXXX');
define('EMAIL_DEFAULT_FROM_NAME', 'XXXXXXXXXXXX');
define('FORM_BLOCK_SENDER_EMAIL', EMAIL_DEFAULT_FROM_ADDRESS);
With Xs swapped out for real data. However, when submitting a forgotten password request the email is still coming from the site admin email address.
If I add the below line into public_html/concrete/mail/forgot_password.php
$from = array(EMAIL_DEFAULT_FROM_ADDRESS, EMAIL_DEFAULT_FROM_NAME);
Then it works fine.
I notice public_html/concrete/core/helpers/mail.php has this code in it:
if (!isset($from)) {
$from = array(EMAIL_DEFAULT_FROM_ADDRESS, EMAIL_DEFAULT_FROM_NAME);
$fromStr = EMAIL_DEFAULT_FROM_ADDRESS;
}
which I would have expected to pick up my values set in site.php without having to enter the $from line in forgot_password.php
Any ideas why the values in site.php aren't being picked up?
C5 version is 5.6.0.2
Cheers, James
Anyone any thoughts?
Try adding this line to site.php as well:
define('EMAIL_ADDRESS_FORGOT_PASSWORD', 'xxx@xxxxx.com'); //from email address for forgot password emails
Thanks that seems to have worked! Is there a list of similar parameters for all the other system generated emails?
I think I remember seeing a list somewhere once ... best hunt around for it.
Wanna mark my earlier reply as best answer?
Wanna mark my earlier reply as best answer?
I found this for you:
http://www.weblicating.com/c5/site-php/...
http://www.weblicating.com/c5/site-php/...