+ Reply to Thread
Results 1 to 9 of 9

Thread: Elgg email coming from bluehost box

  1. #1
    Join Date
    Mar 2008
    Posts
    5

    Default Elgg email coming from bluehost box

    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.

  2. #2
    Join Date
    Mar 2008
    Posts
    5

    Default

    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
    Code:
    $headers = "From: $sitename <$from>\r\n"
    4. ...and changed it to:
    Code:
    $headers = "From: $sitename <admin@domainname.com>\r\n"

  3. #3
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    Why didn't you just change the value assigned to $from?

  4. #4
    Join Date
    Mar 2008
    Posts
    5

    Default

    Quote Originally Posted by felgall View Post
    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.

  5. #5
    Join Date
    Jan 2009
    Posts
    3

    Default

    Quote Originally Posted by felgall View Post
    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

  6. #6
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    Quote Originally Posted by wbeale2000 View Post
    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.

  7. #7
    Join Date
    Jan 2009
    Posts
    3

    Default probs

    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

  8. #8
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,533

    Default

    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.

  9. #9
    Join Date
    Jan 2009
    Posts
    3

    Default

    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

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts