Mail problem with php script
06-19-2006, 08:11 AM
|
Mail problem with php script
|
Posts: 73
Location: England
|
Hi guys,
i seem to have a problem with a script that i bought wich i have used befor on a windows server with no probs but now i am on unix server the script is not working.
The scrpit is for a digital delivery wher it sends out email to the buyer,
but when i do a test with the scripts the server itself replys "No recipient addresses found in header" this message is not part of the script.
Can some one Please take a look for me as i dont know any thing about php, her are the two file that do the emails i think
ebay.php
PHP Code:
<?php $SQL = "SELECT * from SETTINGS"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $one_pathtopixie = $row["PATHTOPIXIE"]; } $SQL = "SELECT * from EBAYLISTINGS WHERE IDNUMBER='$item_number' OR IDNUMBER ='$item_name'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $e_idnumber = $row["IDNUMBER"]; $e_eidn = $row["EIDN"]; $e_filelink = $row["FILELINK"]; $e_item_name = $row["ITEM_NAME"]; $e_pref = $row["PREF"];} $sql = "INSERT INTO SALES SET IDNUMBER ='$e_idnumber', EIDN='$e_eidn', FILELINK='$e_filelink', ITEM_NAME='$e_item_name', PAYER_EMAIL='$payer_email', PREF='$e_pref' , TYPE='EBAY' , `DATE` = CURDATE( ), `MEMO` = '$memo', `FIRST_NAME` = '$first_name', `LAST_NAME` = '$last_name', `ADDRESS_STREET` = '$address_street', `ADDRESS_CITY` = '$address_city', `ADDRESS_STATE` = '$address_state', `ADDRESS_ZIP` = '$address_zip', `ADDRESS_COUNTRY` = '$address_country', `ADDRESS_STATUS` = '$address_status'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); $SQL = "SELECT * from SALES WHERE IDNUMBER='$item_number' OR IDNUMBER ='$item_name' AND PAYER_EMAIL = '$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $s_idnumber = $row["IDNUMBER"]; $s_id = $row["ID"]; $s_eidn = $row["EIDN"]; $s_filelink = $row["FILELINK"]; $s_item_name = $row["ITEM_NAME"]; $s_payer_email = $row["ITEM_NAME"]; $s_pref = $row["PREF"];} $SQL = "SELECT * from EMAILSETTINGS WHERE IDNUMBER='$e_eidn'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $s_froom = $row["FROOM"]; $s_subject = $row["SUBJECT"]; $s_message = $row["MESSAGE"];} #----- PREP THE EMAIL -----> if ($e_pref == Yes) { $ebd = "ebd/"; $to="$payer_email"; $headers.= "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; "; $headers.= "charset=iso-8859-1\r\n"; $headers.= "From: $s_froom"; $subject = "$s_subject"; $body = "<html> $s_message <br><br> <a href=$one_pathtopixie$ebd?payer_email=$payer_email>Download Now</a> <br><br> If your Browser does not support HTML You will be required to enter your order number and item number into our system to download your purchase. <br><br> Your Order Number : $s_id <br> Your Item Number : $s_idnumber <br><br> Copy and paste the following link into your browser : <br><br> $one_pathtopixie$ebd</html> "; } elseif ($e_pref == No) { $to="$payer_email"; $headers.= "MIME-Version: 1.0\r\n"; $headers.= "Content-type: text/html; "; $headers.= "charset=iso-8859-1\r\n"; $headers.= "From: $s_froom"; $subject = "$s_subject"; $body = "<html>$s_message</html>"; } else {} ?>
grip.php
PHP Code:
<?php require '../grig-agent/ipn.php'; include '../grig-agent/sqlinf.php'; if ($for_auction == 'true') {} else die(); #------------------------------------------------------- $chars = "abcdefghijklmnopqrstuvwxyz"; $len = strlen($chars); mt_srand((double)microtime() * 1000000); for ($i = 0; $i < 5; $i++) { $randomize = mt_rand(0, $len); $password .= $chars{$randomize}; } #------------------------------------------------------- $SQL = "SELECT * from MEMBERS WHERE USERNAME = '$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $payer_e = $row["USERNAME"];} if ($payer_email == $payer_e) {}else{ $sql = "INSERT INTO MEMBERS SET USERNAME ='$payer_email' , PASSWORD='$password' , TYPE='$custom'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());} $SQL = "SELECT * from MEMBERS WHERE USERNAME='$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $payer_e = $row["USERNAME"]; $password = $row["PASSWORD"];} #------------------------------------------------------- $SQL = "SELECT * from MAILINGLIST WHERE PAYER_EMAIL='$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $p_e = $row["PAYER_EMAIL"]; $product = $row["PRODUCT"];} $a = "$payer_email$item_number"; $b = "$p_e$product"; if ($a == $b) {} else { $sql = "INSERT INTO MAILINGLIST SET PAYER_EMAIL$payer_emailcom' , PRODUCT ='$item_number'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); } ################################################## require 'ebay.php'; ################################################## $send_check=mail($to,$subject,$body,$headers); if ($send_check!=true) { echo 'An error occurred while sending mail1.'; echo '<br>'; echo $hmm; die(); } ?> <html> <head> <title>GrigEbaySuite</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <table border="1" cellspacing="9" cellpadding="6" bordercolor="#DCDCCD" width="170" align="center"> <tr> <td bgcolor="#F9F9F9"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">If you are seeing this screen, Grig has just completed a test delivery. Click back to continue, you should have an email in your mailbox at any moment.</font></div> </td> </tr> </table> </body> </html>
Last edited by Taylor1984; 06-19-2006 at 08:15 AM..
|
|
|
|
06-21-2006, 09:06 PM
|
Re: Mail problem with php script
|
Posts: 13
|
Try removing the '\r' characters from '\r\n' and leave the '\n' only. Mass replace '\r\n' to '\n'.
|
|
|
|
06-23-2006, 09:43 AM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
thanks for the help, but no it still ses the same thing
|
|
|
|
06-23-2006, 04:01 PM
|
Re: Mail problem with php script
|
Posts: 160
|
What do you get when you echo "$payer_email"; just before the email creation is attempted?
|
|
|
|
06-24-2006, 07:57 AM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
nothing out of the normal as the scripte thinks ever thing went throuw ok as it dispalys "If you are seeing this screen, Grig has just completed a test delivery.
Click back to continue, you should have an email in your mailbox at any
moment." but there is an extra message witch is not part of the script saying "No recipient addresses found in header"
|
|
|
|
06-24-2006, 09:01 AM
|
Re: Mail problem with php script
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
every chance one of these is probably wrong
PHP Code:
$s_item_name = $row["ITEM_NAME"];
$s_payer_email = $row["ITEM_NAME"];
to see the error stop the script running after the echo
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-24-2006, 04:15 PM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
dont no how to do that as i dont no nothing about php, can you explan for me how i do that
thanks ever one so far for trying to get this to work
|
|
|
|
06-24-2006, 06:43 PM
|
Re: Mail problem with php script
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
instead of this,
PHP Code:
$send_check=mail($to,$subject,$body,$headers);
(comment it out) Use
PHP Code:
$send_check = false;
and echo $s_payer_email in the error handler
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-25-2006, 05:51 AM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
did that and the error was
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/sites/dalesells1984.co.uk/public_html/GrigEbaySuite/grig/grig.php on line 57
have i don the changes right
grip.php
PHP Code:
<?php require '../grig-agent/ipn.php'; include '../grig-agent/sqlinf.php'; if ($for_auction == 'true') {} else die(); #------------------------------------------------------- $chars = "abcdefghijklmnopqrstuvwxyz"; $len = strlen($chars); mt_srand((double)microtime() * 1000000); for ($i = 0; $i < 5; $i++) { $randomize = mt_rand(0, $len); $password .= $chars{$randomize}; } #------------------------------------------------------- $SQL = "SELECT * from MEMBERS WHERE USERNAME = '$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $payer_e = $row["USERNAME"];} if ($payer_email == $payer_e) {}else{ $sql = "INSERT INTO MEMBERS SET USERNAME ='$payer_email' , PASSWORD='$password' , TYPE='$custom'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());} $SQL = "SELECT * from MEMBERS WHERE USERNAME='$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $payer_e = $row["USERNAME"]; $password = $row["PASSWORD"];} #------------------------------------------------------- $SQL = "SELECT * from MAILINGLIST WHERE PAYER_EMAIL='$payer_email'"; $result = mysql_query( $SQL ); while( $row = mysql_fetch_array( $result ) ) { $p_e = $row["PAYER_EMAIL"]; $product = $row["PRODUCT"];} $a = "$payer_email$item_number"; $b = "$p_e$product"; if ($a == $b) {} else { $sql = "INSERT INTO MAILINGLIST SET PAYER_EMAIL$payer_emailcom' , PRODUCT ='$item_number'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); } ################################################## require 'ebay.php'; ################################################## $send_check = false; if ($send_check!=true) { echo $s_payer_email in the error handler echo 'An error occurred while sending mail1.'; echo '<br>'; echo $hmm; die(); } ?> <html> <head> <title>GrigEbaySuite</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <table border="1" cellspacing="9" cellpadding="6" bordercolor="#DCDCCD" width="170" align="center"> <tr> <td bgcolor="#F9F9F9"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">If you are seeing this screen, Grig has just completed a test delivery. Click back to continue, you should have an email in your mailbox at any moment.</font></div> </td> </tr> </table> </body> </html>
Last edited by Taylor1984; 06-25-2006 at 05:59 AM..
|
|
|
|
06-25-2006, 06:08 AM
|
Re: Mail problem with php script
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
 You're that new to coding then
The "in the error handler" was where to put the echo rather than part of it of the statement
PHP Code:
$send_check = false;
if ($send_check!=true)
{
echo $s_payer_email;
// rest of code goes here
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-25-2006, 07:16 AM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
sorry i did kind of no that but was still a bit sleepy,
right i think i got it right now after doing the changes it came up with
"An error occurred while sending mail1."
|
|
|
|
06-25-2006, 10:21 AM
|
Re: Mail problem with php script
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
then if you didn't see a email address come up it's empty
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-25-2006, 10:53 AM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
so its got to be some thing to do with the database as this script allso makes a mailing list witch is going in ok. i think i will just strat lerning php then make my own or fix this.
well thanks for all your help
Dale
Last edited by Taylor1984; 06-25-2006 at 10:55 AM..
|
|
|
|
06-25-2006, 03:20 PM
|
Re: Mail problem with php script
|
Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
|
did you fix the error I posted in post #6 ?
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
06-26-2006, 08:43 AM
|
Re: Mail problem with php script
|
Posts: 73
Location: England
|
no but there is a lot of files that go with this script so i though it mite be to much to ask people on her to fix it, plus i dont know any thing about php only some html, if you can fix tho i would grate fall
|
|
|
|
06-28-2006, 04:02 PM
|
Re: Mail problem with php script
|
Posts: 7
|
Good luck with you PHP problem bud, just don't let it piss you off too much. 
|
|
|
|
|
« Reply to Mail problem with php script
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|