[PHP] mail() returned a strange error, what is this?

2002-05-29 Thread Magnus Hammar

I used the mail() function in php and it returned errors like these:
--
Warning: Mail delivery program returned with exit code: 17152 in
/www/htdocs/mail_webmaser.php on line 216

Warning: Mail delivery program returned: Undefined error: 0 in
/www/htdocs/mail_webmaser.php on line 216
--

Can anyone explaun why I get these errors, mail() with sendmail is
working fine with other php-sites on the server...

Thanks.
/Magnus Hammar



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




[PHP] SMTP-access with PHP...

2001-06-20 Thread Magnus Hammar

Hello!

Why do I get this error (Relaying denied ) from my SMTP-server and how do I
make it work?

220 mail.server.com ESMTP Sendmail 8.9.3/8.9.3; Wed, 20 Jun 2001 15:09:06
+0200 (CEST) 
250 mail.server.com Hello localhost [127.0.0.1], pleased to meet you
250 [EMAIL PROTECTED] Sender ok
550 [EMAIL PROTECTED] Relaying denied
503 Need RCPT (recipient)

Is there something else I can do to make it work?
I use this code:
-
$smtp_server = "localhost";
$port_number= 25;
$smtp_connection= fsockopen($smtp_server, $port_number);
if(!$smtp_connection){
$smtp_connection= fopen($smtp_server.":$port_number","w");
}
if(!$smtp_connection){
$return_value = "SMTP-server not responding!";
return 0;
}else{
fputs($smtp_connection, "");
$return_value = $return_value.fgets($smtp_connection,128)."";
fputs($smtp_connection, "HELO $smtp_server\n");
$return_value = $return_value.fgets($smtp_connection,128)."";
fputs($smtp_connection, "");
fputs($smtp_connection, "MAIL FROM: $from\n");
$return_value = $return_value.fgets($smtp_connection,128)."";
fputs($smtp_connection, "");
fputs($smtp_connection, "RCPT TO: $till\n");
$return_value = $return_value.fgets($smtp_connection,128)."";
fputs($smtp_connection, "");
fputs($smtp_connection, "DATA\n");
$return_value = $return_value.fgets($smtp_connection,128)."";
fputs($smtp_connection, "Subject: $subjekt\n");
fputs($smtp_connection, "Reply-To: $from\n");
fputs($smtp_connection, "MIME-Version: 1.0\n");
fputs($smtp_connection, "Content-Type: text/plain; charset=iso-8859-1\n");
fputs($smtp_connection, "Content-Transfer-Encoding: 8bit\n");
fputs($smtp_connection, "X-mailer: Magnus Mail");
fputs($smtp_connection, "\n\n");
fputs($smtp_connection, "$bodyn\n\r");
fputs($smtp_connection, "");
$return_value = $return_value.fgets($smtp_connection,128)."";
fputs($smtp_connection, "");
fputs($smtp_connection, "QUIT\n\r");
$return_value = $return_value.fgets($smtp_connection,128)."";
fclose($smtp_connection);
return $return_value;


/Magnus Hammar
--




Re: [PHP] Cookie Not Setting..

2001-07-11 Thread Magnus Hammar

Some things to keep in mind:

1. The cookie can't be read untill the next time you access a page.

2. The cookie can only be red in the same level as it is set (I guess), that
means that if you set a cookie in "/my/pages/index.php" you can't read the
cookie from a page in "/my/index.php".

3. To really see if the cookie is set you can use Netscape and let it warn
you before accepting a cookie, in that way you will see the cookiename and
it's value and then you can be sure the cookie is set.

4. You can do the same thing with IE.

/Magnus Hammar - The cookiemonster? =)
--
> Still no luck.  Do I have to read a cookie before any HTML is sent as well?
> I know to set it before it is sent but reading?
> 
> Jeff
> - Original Message -
> From: "Magnus Hammar" <[EMAIL PROTECTED]>
> To: "Jeff Lewis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, July 11, 2001 9:30 AM
> Subject: Re: [PHP] Cookie Not Setting..
> 
> 
>> Try this:
>> 
>> $cookie_name= "wwblCookie";
>> $value  = "PLEASE";
>> $exp= time() + (86400 * 365);
>> $server = "www.domain.com"; // Or IP-address will also do fine
>> // the domain must cuntain three "."
>> // as in ".somedomain.com"
>> $secure = 0;
>> setcookie($cookie_name, $value, $exp, "/", $server,$secure);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]