Chezshire Posted July 5, 2010 Share Posted July 5, 2010 Hello everyone, currently i have a small site with a few moderators which change (frequently), as such I have to update a lot of scripts so that they will receive notifications so they can do they're thing. I am currently trying to simplify the process down so that I have only one file to update vs. twenty plus files to update by using the 'file_get_contents' in the mail call. However, when I tried this i get no results -- everything appears to work, but no notices/emails go out. Below is an example of the script -- (from line #314 to #323). It would be really awesome if someone could tell me what boneheaded thing I am or am not doing to make this work correctly. Thank you for any and all help (and please know that I am a complete newb who once he gets this headache resolved is going to try to make a function to do it so he doesn't have to update anything -- but i need to go one step at a time as I really don't know what I am doing). Script as it was (This one works - but i have to manually update it everytime their is a change in moderators) if (!$APPROVED && !$id) { mail("ADAMS <[email protected]>, DITKO <[email protected]>, VAUGHAN <[email protected]>", "[$siteName] New Player", "A new member has submitted a profile to the $siteName website.\n\nName: $NAME\nUsername: $USERNAME\n\nVisit this URL to approve the member:\nhttp://www.xaviers-children.net/home.php", "Return-Path: xaviers-children <[email protected]>\nErrors-To: xaviers-children.net <[email protected]>\nFrom: xaviers-children <[email protected]>\nReply-To: xaviers-children.net <[email protected]>\nX-Mailer: PHP/" . phpversion()); } This is what I'm trying to change it to so I only have to update a text file using the get_file_contents function Script as it was (This one works - but i have to manually update it everytime their is a change in moderators) $emailAddresses = file_get_contents("_modEmailAddresses.txt"); $to = $emailAddresses; if (!$APPROVED && !$id) { mail($emailAddresses, "[$siteName] New Player", "A new member has submitted a profile to the $siteName website.\n\n Name: $NAME\nUsername: $USERNAME\n\n Visit this URL to approve the member:\nhttp://www.xaviers-children.net/home.php", "Return-Path: xaviers-children <[email protected]>\n Errors-To: xaviers-children.net <[email protected]>\n From: xaviers-children <[email protected]>\n Reply-To: xaviers-children.net <[email protected]>\n X-Mailer: PHP/" . phpversion()); } This is the text file I am calling with the email addresses ADAMS <[email protected]>, DITKO <[email protected]>, NICIEZA <[email protected]>, STERANKO <[email protected]>, VAUGHAN <[email protected]> Any help is very thankfully received and appreciated Thanks Chez Link to comment https://forums.phpfreaks.com/topic/206807-mail-file_get_contents-arent-playing-well-together-help/ Share on other sites More sharing options...
Chezshire Posted July 5, 2010 Author Share Posted July 5, 2010 Update: I tried revising my code like so -- but I still get no notice, everything else on the site appears to be working though. I'm very confused. if (!$APPROVED && !$id) { echo mail(file_get_constants("_modEmailAddresses.txt"), "[$siteName] New Player", "A new member has submitted a profile to the $siteName website.\n\n Name: $NAME\nUsername: $USERNAME\n\n Visit this URL to approve the member:\nhttp://www.xaviers-children.net/home.php", "Return-Path: xaviers-children <[email protected]>\n Errors-To: xaviers-children.net <[email protected]>\n From: xaviers-children <[email protected]>\n Reply-To: xaviers-children.net <[email protected]>\n X-Mailer: PHP/" . phpversion()); } Link to comment https://forums.phpfreaks.com/topic/206807-mail-file_get_contents-arent-playing-well-together-help/#findComment-1081593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.