View Full Version : Elgg email coming from bluehost box
nickr
08-18-2008, 11:00 PM
I've set up Elgg v1.0, but email notification comes from username@boxXXX.bluehost.com. I know you can fix this problem in Wordpress by setting up a wordpress@domain.com email account, but how about Elgg?
My domain is subdomain.domain.com. I've tried admin@subdomain.domain.com and admin@domain.com for email addresses without luck. Is the bit before the "at" important, and if so, what should it be?
Thanks to anyone who can shine some light on this.
nickr
08-19-2008, 01:11 AM
Solved. This is how I did it:
1. I set up an email account for the main domain, e.g. admin@domainname.com
2. In Elgg, I opened /engine/lib/notification.php
3. I found
$headers = "From: $sitename <$from>\r\n"
4. ...and changed it to:
$headers = "From: $sitename <admin@domainname.com>\r\n"
felgall
08-19-2008, 02:43 AM
Why didn't you just change the value assigned to $from?
nickr
08-19-2008, 04:53 AM
Why didn't you just change the value assigned to $from?
Because $from is passed around between files, and since I've only just installed Elgg and haven't a clue where anything is, my solution was easier. :p
wbeale2000
01-07-2009, 09:04 AM
Why didn't you just change the value assigned to $from?
hi felgall
can you give me the entire code line i need to change please asi have the same problem.
thanks cash for putting me on to this and thanks felgall in advance
wayne
felgall
01-07-2009, 12:53 PM
can you give me the entire code line i need to change please asi have the same problem.
It is just about impossible to say what to change in your code without seeing the code.
wbeale2000
01-08-2009, 09:34 AM
hi cash and felgall
Cash your fix worked but ive just noticed that new users dont get an e-mail sent upon reg...
Also the fix doesnt work for the mass mailout plugin i get the same problem
heres some code for that application it in the mass_mailouts/index.php
$site = $CONFIG->site;
if (($site) && (isset($site->email))) // Has the current site got a from email address?
$from = $site->email;
else if (isset($from->url)) // If we have a url then try and use that.
{
$breakdown = parse_url($from->url);
$from = 'noreply@' . $breakdown['host']; // Handle anything with a url
}
else // If all else fails, use the domain of the site.
$from = 'noreply@' . get_site_domain($CONFIG->site_guid);
$headers = "From: \"{$CONFIG->site->name}\" <{$CONFIG->site->email}>\r\n"
. "Content-Type: text/html; charset=UTF-8; format=flowed\r\n"
. "MIME-Version: 1.0\r\n"
. "Content-Transfer-Encoding: 8bit\r\n";
mail($email, sprintf($email_subject, $CONFIG->site->name),wordwrap($emailmessage), $headers);
}
}
system_message(elgg_echo('mass_mailouts:success')) ;
$result = elgg_echo('mass_mailouts:success');
} else {
register_error(elgg_echo('mass_mailouts:failure')) ;
$result = elgg_echo('mass_mailouts:failure');
i hope that helps
felgall
01-08-2009, 02:01 PM
That code looks like it is trying to send from a noreply@ email address. Have you actually created that email address so that there is a n address for replies to go to as you can't send from an address that doesn't exist.
wbeale2000
01-09-2009, 02:57 AM
yes i have as it works fine from my message boards, unfortunately i dont yet have a grasp of the code but im hoping to understand it a bit better in the next 3 months
thanks felgall
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.