|
Posted by peter on 05/27/07 12:02
>I am just starting out and working with a tutorial on php mail
> I used this to send mail but didn't receive anything in my mail
> Sould I be looking to setup something in PHP 5.0 to fix this problem?
>
> <?php
> $file_loc = "mydata.txt";
> $whattoread = fopen($file_loc, "r");
>
> $file_contents = fread($whattoread, filesize($file_loc));
> fclose($whattoread);
>
> $mailheaders = "From: my web site <> ";
> mail("kraleigh@sbcglobal.net", "File contents", $file_contents,
> $mailheaders);
> echo ("check your mail");
>
>
> ?>
>
Going by your other post you are using a windows box. You will need to edit
the php.ini file and enable/change the smtp configuration. Also try sending
an email without any headers etc and a generic title and content.
In your example code you have not put any newlines after the header (\r\n)
but if you do as I suggested first you will ensure that the setup is correct
before bringing in complications.
Navigation:
[Reply to this message]
|