dellee Posted January 5, 2008 Share Posted January 5, 2008 I have PPV Chat installed on a shared server with Hostmonster and they said there is a syntax error not letting the emails be sent out to newly registered users so they may activate their accounts. I was told that the problem is in the following code, Does anyone see a problem in the reply-to header? Any help in fixing this code would be great. Thanks Here is the error I was sent by my hosting company. I am running on Php5. +++ 1JAuKu-0005ST-HA has not completed +++ 2008-01-04 14:44:16 1JAuKu-0005ST-HA H=localhost (host97.hostmonster.com) [127.0.0.1] F=<fmsdesig@host97.hostmonster.com> rejected after DATA: syntax error in 'Reply-To:' header when scanning for sender: malformed address: ' may not follow 'support@fmsdesigns.com in "'support@fmsdesigns.com'" <? include("_main.header.php"); ?> <div align="center"></div> <table width="720" height="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle"><p> </p> <p> </p> <p> </p> <p> </p> <table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="51"><p class="message"> <? $result=mysql_query("SELECT email,user,password,emailtype,status from chatusers WHERE id = '$_GET[uID]' LIMIT 1"); while($row = mysql_fetch_array($result)) { $email=$row['email']; $user=$row['user']; $pass=$row['password']; $my_pass=$row['password']; $db_pass=md5($pass); $status=$row['status']; $emailtype=$row['emailtype']; } if ($status!="pending"){ echo 'This account has already been activated!'; } else{ mysql_query("UPDATE chatusers SET password='$db_pass', status='active' WHERE id ='$_GET[uID]' LIMIT 1"); if ($emailtype=="text"){ $charset="Content-type: text/plain; charset=iso-8859-1\r\n"; $message = "Welcome! You have been successfully registered with $sitename. Here's your login information: Username: $user Password: $my_pass You can now access your account at: $siteurl/login.php?user=$user Thank you! $sitename This is an automated response. Please do not reply!"; } else if($emailtype=="html"){ $charset="Content-type: text/html; charset=iso-8859-1\r\n"; $message = "Welcome! You have been successfully registered with $sitename. Here's your login information: Username: $user Password: $my_pass You can now access your account at: <a href='$siteurl/login.php?user=$user'>$siteurl/login.php?user=$user</a> Thank you! $sitename This is an automated response. Please do not reply!"; }else { echo"E-Mail variable not set"; } $subject = "Welcome to $sitename"; mail($email, $subject, $message,"MIME-Version: 1.0\r\n".$charset."From:".$registrationemail."\r\n"."Reply-To:'".$registrationemail."'\r\n"."X-Mailer: PHP/".phpversion() ); echo 'Thank you! Your member account has been activated. You can now access your account <a href="login.php">HERE</a>.'; } ?><br> </p> </td> </tr> <tr> <td> </td> </tr> </table> <p> </p> <p> </p> <p> </p></td> </tr> </table> <br> <? include("_main.footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/ Share on other sites More sharing options...
gerkintrigg Posted January 5, 2008 Share Posted January 5, 2008 try modifying this: <?php $to_name='dave';// member name goes here $from_name='your company here';// who it's from - you can change this to whatever $to_email='your_client@whatever.com'; $from_email='Your Address'; // getting the picture yet? ;o) //Subject $subject='Chat membership:'; // Message $my_message = 'This is a quick communication from whatever to let you know that '.$from_name.' has written the following message for you: '.$message.' To contact this person via email, you should click "reply" to this message.'; // Do not edit below this line!! //----------------------------------------------------------------------------- // Recipients. You can send it to more than 1 person! $to = $to_name." <".$to_email.">"; // This is the email subject $my_subject = $subject; // Setting additional headers $my_headers .= "From: ".$from_name." <".$from_email.">\r\n"; // And now mail it! mail($to, $my_subject, $my_message, $my_headers); ?> I think that'll work. You do need to fill in with some databasey details I presume. All the best, Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431151 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 Thanks for the reply but my problem is that I would not have any idea of how to use that code without destrying the file. I thought maybe sombody would see the error and tell me where it is so I can try to fix it, I am not very good with php at all Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431157 Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 Try using this as your mail() code mail($email, $subject, $message,"From:".$registrationemail); If it works, then add each header one at a time. Maybe your Reply-To header is incorrect. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431176 Share on other sites More sharing options...
gerkintrigg Posted January 5, 2008 Share Posted January 5, 2008 yeah. You can do the same with my code too - it's always good when debugging, to add breaks into the code too, to see what works up until what point. Thankfully, PHP is fairly linear in the way it goes through code, so you can work out fairly quickly where things are going wrong. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431183 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 That does not seem to work either. The registrationemail typed into another file called settings.php so how is this file getting that information? Do I need to require the settings.php file in this file or do I need to put the $registrationemail in this file? I feel pretty stupid here as I don't fully understand what I am doing. My server just does not seem to be sending the emails out but my server sends out emails for other scripts so I know it's working. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431185 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 Well I've been on this for 16 hours straight so I can see now there is no fix so I do believe I'll give up and pitch this script out the window. Thanks for the replys & help. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431194 Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 Check your php.ini under the mail settings for any entries. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431199 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 Not sure where that is, I am in the server via FTP client WS FTP but I don't know where to find that php.ini for the mail. I looked in the root but didn't see anything. The main php.ini in the root has only one thing registerglobals=on Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431218 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 would this error make more sense if you had the entire script instead of the code from the one file I posted? Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431236 Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 Not really, you need to find the php.ini that's being used. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431237 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 within this script there is no php.ini file other than that there are a few different php.ini files in other folders containing scripts but that has nothing to do with this script. What php.ini file am I looking for? The one in the root only has registerglobals=on thats all. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431245 Share on other sites More sharing options...
Ken2k7 Posted January 5, 2008 Share Posted January 5, 2008 Try: (I think there are variables that are undefined, unless you did them in _main.header.php) <?php include("_main.header.php"); ?> <div align="center"></div> <table width="720" height="200" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle"><p> </p> <p> </p> <p> </p> <p> </p> <table width="600" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="51"><p class="message"> <?php $result=mysql_query("SELECT * FROM chatusers WHERE id = '{$_GET['UID']}' LIMIT 1"); while($row = mysql_fetch_assoc($result)) { $email=$row['email']; $user=$row['user']; $pass=$row['password']; $my_pass=$row['password']; $db_pass=md5($pass); $status=$row['status']; $emailtype=$row['emailtype']; } if ($status!="pending"){ echo 'This account has already been activated!'; } else{ mysql_query("UPDATE chatusers SET password='$db_pass', status='active' WHERE id ='{$_GET['UID']}' LIMIT 1"); /* CHECK: ARE ALL THESE VARIABLES DEFINED? */ if ($emailtype=="text"){ $charset="Content-type: text/plain; charset=iso-8859-1\r\n"; $message = "Welcome! You have been successfully registered with $sitename. Here's your login information: Username: $user Password: $my_pass You can now access your account at: $siteurl/login.php?user=$user Thank you! $sitename This is an automated response. Please do not reply!"; } else if($emailtype=="html"){ $charset="Content-type: text/html; charset=iso-8859-1\r\n"; $message = "Welcome! You have been successfully registered with $sitename. Here's your login information: Username: $user Password: $my_pass You can now access your account at: <a href='$siteurl/login.php?user=$user'>$siteurl/login.php?user=$user</a> Thank you! $sitename This is an automated response. Please do not reply!"; }else { echo"E-Mail variable not set"; } $subject = "Welcome to $sitename"; mail($email, $subject, $message,"MIME-Version: 1.0\r\n".$charset."From:".$registrationemail."\r\n"."Reply-To:'".$registrationemail."'\r\n"."X-Mailer: PHP/".phpversion() ); echo 'Thank you! Your member account has been activated. You can now access your account <a href="login.php">HERE</a>.'; } ?><br> </p> </td> </tr> <tr> <td> </td> </tr> </table> <p> </p> <p> </p> <p> </p></td> </tr> </table> <br> <?php include("_main.footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431254 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 They are not defined in the header, I don't know how to define them. I was not aware anything was missing from this code it came like this with the script but that was back in php4 days and I am on php5, not sure if that makes a difference. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431257 Share on other sites More sharing options...
Ken2k7 Posted January 5, 2008 Share Posted January 5, 2008 Well $sitename isn't defined before you called it in the message area. That's just one though. There may be others. Despite that, does it work? Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431258 Share on other sites More sharing options...
revraz Posted January 5, 2008 Share Posted January 5, 2008 Try using this as your mail() code, and replace youremail with your actual email address. mail("youremail", "Subject", "Hi","From: youremail"); Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431261 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 Ok, there is this in the header <? include("dbase.php"); include("settings.php"); ?> and dbase.php only has the mysql connection info. here is what is in settings.php <? $sitename="CamScripts"; //site url $siteurl="http://www.fmsdesigns.com/payperview"; //used in registration mails, payment mails... $registrationemail="support@fmsdesigns.com"; $feedbackemail="contact@fmsdesigns.com"; $paymentemail="contact@camscripts.com"; //used for favorites announcements $contactemail="contact@fmsdesigns.com"; $newsletteremail="contact@fmsdesigns.com"; //numbner of hours between giving another 120 seconds of free chat. $freehours=1; //default sop epercentage $sopepercentage=10; $displayofflinemodels=1; $offlinemodelslines=4; $paymentday=24; $freechattime=66666120; $moviequality=100; $moviebandwith=12000; ?> Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431262 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 the script runs fine besides for sending out the new registration emails. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431264 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 yes i can send myself an email by using the code you posted. Sitename is defined in the settings.php file which seems to be called be a require into the header.php file Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431266 Share on other sites More sharing options...
Ken2k7 Posted January 5, 2008 Share Posted January 5, 2008 So you can send yourself an email but not to new people? Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431270 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 correct, I can send myself an email that way but the script just refuses to send out registration emails when a user signs up. Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431272 Share on other sites More sharing options...
Ken2k7 Posted January 5, 2008 Share Posted January 5, 2008 Well you have a table, but wouldn't you need a form for the user to sign up with? Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431281 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 There is, this is a ready made script. Maybe this will answer alot of questions. http://milkcowsnotwar.com/ppvchat.rar Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431284 Share on other sites More sharing options...
Ken2k7 Posted January 5, 2008 Share Posted January 5, 2008 Uh...that's a lot of files. Can you specify the exact file? :-\ Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431289 Share on other sites More sharing options...
dellee Posted January 5, 2008 Author Share Posted January 5, 2008 well, the file that has the email code in it seems to be actm.php in the php folder which is the script the other folders are for flashcom. then the other file that holds email code is for operators signup and it's the same but that file is called actop.php Quote Link to comment https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/#findComment-431292 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.