> I put this PHP script on web server:
>
> <?php
>  if (mail("[EMAIL PROTECTED]", "brati", "peda", "From: Peda")== TRUE)
> print("U redu je");
>  else
> print("Greska");
> ?>
>
> But It seems that mail function doesn't work. I don't get any e-mail.
>
> Can anyone tell me what is wrong.

Does mail() return true? I mean, do you get printed "U redu je"? If so, your
email should've been sent by PHP.

You are really missing a bunch of headers. I'm not sure if this is your
problem, but I think it's not a bad idea to include more headers, also
because more and more ISP's add some kind of spamfilter which might drop
your email. So maybe by adding more headers, you can solve this.

I use this:

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$headers .= "From: Name <[EMAIL PROTECTED]>\r\n";

$body = "Whatever is in your email";

$to = "Name <[EMAIL PROTECTED]>";
$check_mail = mail($to, "Subject", $body, $headers);

--
[Win2000 | Apache/1.3.23]
[PHP/4.2.3 | MySQL/3.23.53]

Ivo Fokkema
PHP & MySQL programmer
Leiden University Medical Centre
Netherlands



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

Reply via email to