Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP mailing list problem
Old 12-29-2005, 04:44 PM PHP mailing list problem
croix's Avatar
Skilled Talker

Posts: 87
Name: Colin Roy
Location: Dallas, TX
Trades: 0
im working on a modifying a mailing list that i found, that will allow me to send email to certain addresses located in a access database.

I dont get any error, but I am not receiving the email. i setup myself in the database, residing in a state that no one else is from, so i can test mail to myself.


heres the code:

PHP Code:
<?php

include("dbconnection.php");
if (!isset(
$_POST['submit'])):

?>
<html>
<head>
</head>
<body>

<?php require_once("adminOnly.php");?>

//theres more html here, but no need to paste it in

</body>
</html>


<?php else:

ini_set(SMTP"mail.sliquid.com");
    
ini_set(smtp_port25);
    
ini_set(sendmail_from"info@sliquid.com");

  
$to $_POST['to'];
  
$subject $_POST['subject'];
  
$message $_POST['message'];
  
$state $_POST['state'];

  if (
"all" == $to) {
   
$x 1;
   
$hold 50// quantity of emails sent before 3 sec delay
   
$emails ="SELECT email FROM customers";

   while (
$sendemail odbc_exec($cnx,$emails)) {
   
$email $sendemail["email"];
   
mail($email$subject$message"From:Sliquid Email List <info@sliquid.com>");
   

   
$x++;
    if(
$x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout
    
sleep(3);
    
$x 0;
    }
   } 
// end of while loop
  


else {
   
$bycountry ="SELECT email FROM customers WHERE state = '$state'";
   while (
$statemail odbc_exec($cnx,$bycountry)) {
   
$email $statemail["email"];
   
$okemail mail($email$subject$message"From:Sliquid Email List <info@sliquid.com>");

   
$x++;
    if(
$x == $hold) { // When $x is equal to $hold, a 3 sec delay will occur avoiding php to timeout
    
sleep(3);
    
$x 0;
    }
   } 
// end of while loop
  
}

?>
<html>
<head>
</head>
<body>

SUCCESS! You will be redirected.
<?php
header
("Refresh: 3; URL=http://www.sliquid.com/protected/admin.php");
echo 
" "// NN4 requires that we output something...
exit();
?>

</body>
</html>
<?php endif; ?>
also, heres my dbconnection.php

PHP Code:
<?php
$cnx 
odbc_connect'records_db' 'Admin''******' );
    if (!
$cnx) {
        
Error_handler"Error in odbc_connect" $cnx );
    }
?>
also, the ini_set stuff is from another page i have that emails properly, but i dont know if i need it for this script.

Last edited by croix; 12-30-2005 at 04:52 PM..
croix is offline
Reply With Quote
View Public Profile Visit croix's homepage!
 
 
Register now for full access!
Reply     « Reply to PHP mailing list problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09344 seconds with 12 queries