1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

phpmailer question - send multiple SMTPs

Discussion in 'PHP' started by sharpweb, Feb 10, 2006.

  1. #1
    I have code that basically looks like this. During testing everything was working fine, but eventually I started to run into problems getting this error: Warning: fsockopen(): unable to connect to 127.0.0.1:25 in /hsphere/local/home/julescar/tbn.com.au/admin/class.smtp.php on line 105
    $mail = new PHPMailer();
    		$mail->IsSMTP();
    		$mail->Host = "127.0.0.1";
    		$mail->From = "newsletter@tbn.com.au";
    		$mail->FromName = "Total Beauty Network";
    		$mail->AddReplyTo("jody@tbn.com.au");
    		while($row = mysql_fetch_array($result)) {
    			$mail->AddAddress("chris@deutz.com.au");
    			$mail->Body = $list;
    			$mail->Subject = "Test Newsletter";
    			$mail->Send();    
    			$mail->ClearAllRecipients();
    		}
    Code (markup):
    My question is, does anyone here happen to know if this is because each mail sent makes a new call to the SMTP server and eventually the system got too busy with my numerous tests. Or would this be due to some other strange reason?

    Is there a way to make sure the connection is opened and closed with as little server load as possible???

    CHeers,
    Chris
     
    sharpweb, Feb 10, 2006 IP