Re: [PHP] emailing MySQL list not working

2005-11-14 Thread Richard Lynch
On Fri, November 11, 2005 9:33 pm, Bruce Gilbert wrote:
   $headers = From: $sender;
   $headers .= Reply-To: $reply_to;
   $headers .= Return-Path: $return_path;

   $headers .= X-Sender: $x_sender;
   $headers .= X-Mailer: PHP4\n; //mailer

These two may trip some spam filters.

   $headers .= X-Priority: 3\n; //1 UrgentMessage, 3 Normal

Setting this at all probably trips a few spam filters.

   $headers .= Mime-Version:1.0\n Content-Type: text/plain;
 charset=\iso-8859-1\nContent-Transfer-Encoding: 8bit\n;

   mail( $recipient, $subject, stripslashes($message), $headers );

Check the return error code!!!
http://php.net/mail

   sleep(1);

Just how many emails are you trying to send with mail()?

http://php.net/mail was never designed for heavy-volume lists...

Look into http://phpclasses.org for something that WAS designed to
handle the volume you need.

 }

 // run second query to automatically dump unsubscribed email
 addresses.


 $query2 = 
   DELETE FROM
   mailinglist
   WHERE
   subscribe='0'
   AND
   confirmed='0' ;

 //run the query
 mysql_query($query2, $link) or die (mysql_error());

Dude, if I unsubscribed, get me off the list *BEFORE* you send out
another email, not after.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] emailing MySQL list not working

2005-11-12 Thread Marco Kaiser
Hi,

try to add in your $headers linebreaks. (\r\n).

-- Marco

 $headers = From: $sender;
 $headers .= Reply-To: $reply_to;
 $headers .= Return-Path: $return_path;
 $headers .= X-Sender: $x_sender;
 $headers .= X-Mailer: PHP4\n; //mailer
 $headers .= X-Priority: 3\n; //1 UrgentMessage, 3 Normal
 $headers .= Mime-Version:1.0\n Content-Type: text/plain;
 charset=\iso-8859-1\nContent-Transfer-Encoding: 8bit\n;

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] emailing MySQL list not working

2005-11-11 Thread Bruce Gilbert
Hello,

I am using a template for an email database. This has a MySQL database
where the end user can sign up to receive my email newsletter, They
subscribe and are entered into a MySQL database that I have set up.
Everything works fine as far as  being entered into the dataase The
problem occurs when I send a test email to the database list. (I am
sending one to myself). The email never gets sent!

the code to send out the email from the MySQL database list is as follows:

?php
// this script is used to as the action for the form on sendmailform.php
// it sends the email to all persons who have subscribed to the
mailinglist and confirmed their subscription

//include the config file
include(config.php);

$subject = $_REQUEST['subject'];
$message = $_REQUEST['message'];

//Variables for the headers
// customize this stuff
$sender = Bruce Gilbert [EMAIL PROTECTED]\n; //put your name and
sending address here
$reply_to = [EMAIL PROTECTED]\n; //reply-to, insert your address
here,  might not be supported by your server
$return_path = [EMAIL PROTECTED]; // return-path, if you have
one, also might not be supported by your server
$x_sender = [EMAIL PROTECTED]\n; //your address, another setting
possibly not supported by your server

$message .= \n\n This is a double opt-in mailing list. All recipients
have confirmed their subscription. If you no longer wish to receive
these emails, please go to http://$list_owner_domain_name \n
Get this custom mailing list system for 
your site. Go to
http://www.karlcore.com for more info! \n;

// this selects the table and orders the results by the name
// it only selects the listings that have been confirmed
$query = 
SELECT
*
FROM
mailinglist
WHERE
subscribe=1
AND
confirmed=1;

$result = mysql_query($query);

while ( $row = mysql_fetch_array($result))
{
$rec_id = $row[rec_id];
$email = $row[email];

$recipient = $email;

$headers = From: $sender;
$headers .= Reply-To: $reply_to;
$headers .= Return-Path: $return_path;
$headers .= X-Sender: $x_sender;
$headers .= X-Mailer: PHP4\n; //mailer
$headers .= X-Priority: 3\n; //1 UrgentMessage, 3 Normal
$headers .= Mime-Version:1.0\n Content-Type: text/plain;
charset=\iso-8859-1\nContent-Transfer-Encoding: 8bit\n;

mail( $recipient, $subject, stripslashes($message), $headers );
sleep(1);

}

// run second query to automatically dump unsubscribed email addresses.
$query2 = 
DELETE FROM
mailinglist
WHERE
subscribe='0'
AND
confirmed='0' ;

//run the query
mysql_query($query2, $link) or die (mysql_error());

mysql_close();

header(location: mailsent.php);
exit;
?

The form is located here:

http://www.inspired-evolution.com/sendmailform.php

let me know if I need to provide any more information.

Thanks!

Bruce Gilbert

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php