ChrisMartino Posted May 6, 2010 Share Posted May 6, 2010 Hello there, Thanks for taking the time to read my thread, Well I have a function to email members by email from the database, Although it dosn't seem to be mailing them, I've done all the correct bug testing procedures although turned up with no luck, I echo'd the variable '$ClientEmail' and it brought the correct email but still no luck with the email failing to send, Here is my function: public function EmailClient($username, $subject, $message) { if($this->IsValidClient($username)) { $CheckName = mysql_real_escape_string($username); $CheckClient = mysql_query("SELECT * FROM clients WHERE Username = '".$CheckName."'"); $Fetch = mysql_fetch_array($CheckClient); $ClientEmail = $Fetch['EmailAddress']; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: '.$Fetch['Username'].' <'.$ClientEmail.'>' . "\r\n"; $headers .= 'From: X-Host Gamehosting <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; $FormLayout = " <html> <p> <img src=\"theme/images/email_head.png\"/><br /> <h1>$subject</h1><br /> </p> <p> $message </p> </html> "; mail($ClientEmail, $subject, $FormLayout, $headers); } } Could anyone please help me with the matter?, Thank you. Link to comment https://forums.phpfreaks.com/topic/200902-mail-problems/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.