Jump to content

Recommended Posts

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");
?>

Link to comment
https://forums.phpfreaks.com/topic/84615-registration-emails-not-being-sent/
Share on other sites

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,

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.

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.

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.

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");
?>

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;

?>

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.