Jump to content

mail problem


jorre13

Recommended Posts

hey

 

i got the following output but no mail is send:

220 haco.com ESMTP MDaemon 9.5.5; Wed, 04 Apr 2007 14:37:41 +0200 
250 haco.com Hello servername, pleased to meet you 
550 , Sender unknown 
503 Unexpected command or sequence of commands 
503 Unexpected command or sequence of commands 

 

this my mailcode

 

<?PHP


//ini_set('display_errors', 1); // 0 = uit, 1 = aan 
//error_reporting(E_ALL); 


    $socket = fsockopen("smtphost","25");


    fwrite($socket,"HELO servername\r\n");

    $buf = fgets($socket,1024) . "<br>";
    fwrite($socket,"MAIL FROM: jordy\r\n");
    $buf .= fgets($socket,1024) . "<br>";


    fwrite($socket,"RCPT TO: <[email protected]>\r\n");
        
    

    fwrite($socket,"DATA\r\n");
    $buf .= fgets($socket,2024) . "<br>";

    $time = time();

    $uur = strftime("%H",$time);
    $min = strftime("%M",$time);

/*    $headers = "MIME-Version:1.0\n";
    $headers .= "Content-Type:text/html;charset=iso-8859-1\n";
    $headers .= "Subject: blaat\r\n";
    $headers .= "From: mailtest<[email protected]>\r\n";*/


	# Common Headers 
	if (strtoupper(substr(PHP_OS,0,3)=='WIN')) { 
	  $eol="\r\n"; 
	} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) { 
	  $eol="\r"; 
	} else { 
	  $eol="\n"; 
	}  

	$now = md5(time().$subject); 

	$headers .= 'From: site Automailer <[email protected]>'.$eol; 
	$headers .= 'Reply-To: site Beheerder <[email protected]>'.$eol; 
	$headers .= 'Return-Path: site <[email protected]>'.$eol;    // these two to set reply address 
	$headers .= "Message-ID: <".$now.".site.scriptmailer@".$_SERVER['SERVER_NAME'].">".$eol; 
	$headers .= "User-Agent: site-MailerScript/1.0".$eol; 
	$headers .= "X-Mailer: PHP v".phpversion().$eol;          // These two to help avoid spam-filters 
	$headers .= "X-Mail-Sender: site mail script".$eol; 

	# Boundry for marking the split & Multitype Headers 
	$mime_boundary=md5(time()); 
	$headers .= 'MIME-Version: 1.0'.$eol; 
	$headers .= "Content-Type: text/plain; charset=iso-8859-1".$eol; 
	$headers .= "Content-Transfer-Encoding: 8bit".$eol; 
	$headers .= "X-Priority: 3 (Normal)".$eol; 
	$headers .= "Importance: Normal".$eol; 




    $body = "<font face=verdana color=blue>test</font>";

    fwrite($socket,"$headers\n\n$body\r\n.\r\n");

    
    fwrite($socket,"QUIT\r\n");
    $buf .= fgets($socket,1024) . "<br>";
    $buf .= fgets($socket,1024) . "<br>";

    echo $buf;

    fclose($socket);
    
?> 

Link to comment
https://forums.phpfreaks.com/topic/45542-mail-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.