sorry,

si tratta dello script PHP_Multiple_Newsletters_v2.7, questo è il pezzo di codice della composizione e invio email:

Codice PHP:


                    
IF (mysql_num_rows($result) > '0')
                        {

    
// SEND THE EMAIL VIA SOCKETS

                        
include ('../class/class.phpmailer.php');
                        
$mail = new phpmailer();
                        
$mail -> SMTPKeepAlive 'true';
                        
$mail->IsSMTP();
                        
$mail->Host $sockethost;

                        IF (
$smtpauth == 'TRUE')
                            {
                            
$mail -> SMTPAuth 'true';
                            
$mail -> Username $smtpauthuser;
                            
$mail -> Password $smtpauthpass;
                            }

                        
$mail->From $socketfrom;
                        
$mail->FromName $socketfromname;
                        
$mail->AddReplyTo($socketfrom$socketfromname);
                        
$mail -> Subject $_POST['subject'];

                        WHILE (
$row = @mysql_fetch_array($result))
                            {
                            
extract($row);

                            
$final_tip $trackingurl.'caseid=trackit&archive_id='.$archive_id.'&members_email='.$members_email.'&newsid='.$_GET['newsid'];

                            IF (
$members_mailpref == 'html')
                                {
                                
$body = (ereg_replace('MEMBERNAMEHERE'stripslashes($members_name), stripslashes($newsletter_htmlemail)));
                                
$body = (ereg_replace('NEWSLETTERBODY'nl2br(stripslashes($_POST['newslettertexthtml'])), stripslashes($body)));

                                
$mail -> IsHTML(true);
                                }
                                ELSE
                                    {
                                    
$body = (ereg_replace('MEMBERNAMEHERE'stripslashes($members_name), stripslashes($newsletter_plainemail)));
                                    
$body = (ereg_replace('NEWSLETTERBODY'stripslashes($_POST['newslettertextplain']), stripslashes($body)));

                                    
$mail -> IsHTML(false);
                                    }

                            
$body = (ereg_replace('NEWSLETTERTITLEHERE'stripslashes($newsletter_title), stripslashes($body)));
                            
$body = (ereg_replace('NEWSLETTERDESCRIPTIONHERE'stripslashes($newsletter_description), stripslashes($body)));
                            
$body = (ereg_replace('MEMBEREMAILHERE'stripslashes($members_email), stripslashes($body)));
                            
$body = (ereg_replace('MEMBERIP'stripslashes($members_ip), stripslashes($body)));
                            
$body = (ereg_replace('MEMBERDATE'stripslashes($date), stripslashes($body)));
                            
$body = (ereg_replace('SITENAMEHERE'stripslashes($sitename), stripslashes($body)));
                            
$body = (ereg_replace('SITEURLHERE'stripslashes($siteurl), stripslashes($body)));
                            
$body = (ereg_replace('TRACKINGURL'nl2br(stripslashes($final_tip)), stripslashes($body)));

                            
$mail -> Body $body;
                            
$mail -> AddAddress($members_email$members_name);

                            IF(!
$mail->Send())
                                
$msg 'ERROR: Mail not sent to '.$members_email;
                            
                            
$mail -> ClearAddresses();

                            
$mail -> SmtpClose();
                        }