468,296 Members | 1,270 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,296 developers. It's quick & easy.

Problems with mail()

I'm just tinkering with PHP and learning the basics ; all well and good
so far, except I can't get mail() to work.

I'm running Apache 2 & PHP 4.3.9, and ssmtp on Gentoo. ssmtp is set up
correctly (I can use "sendmail" in evolution fine).

When I post from PHP it seems to work ok except it's emailed to
ap****@autismuk.freeserve.co.uk (according to my log). I've tried setting
the sendmail directory option in php.ini to /usr/lib/sendmail & that
doesn't work either..... I'm mystified.

Am I doing something obviously wrong ?
Any ideas ?

<?php

$msg = "Name: $_POST[name]\n";
$msg .= "E-Mail: $_POST[email]\n";
$msg .= "Message: $_POST[message]\n";

$recipient = "au******@autismuk.freeserve.co.uk";
$subject = "Form submission results";
$mailheaders = "From: My Web Site <au******@autismuk.freeserve.co.uk> \n";
$mailheaders = "Reply-To: $_POST[email]";
$mailheaders = ""; // this line in or out makes no odds ....
mail($recipient,$subject,$msg,$mailheaders) or die("Failed to send");

print "Message sent successfully.<br>";

?>
Jul 17 '05 #1
1 1423
Paul Robson <au******@autismuk.freeserve.co.uk> wrote in
news:pa****************************@autismuk.frees erve.co.uk:
$recipient = "au******@autismuk.freeserve.co.uk";


try

$recipient = "<au******@autismuk.freeserve.co.uk>";
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by James M. Luongo | last post: by
1 post views Thread by dan glenn | last post: by
5 posts views Thread by Jack Smash | last post: by
5 posts views Thread by Dave Brueck | last post: by
1 post views Thread by Stephajn Craig | last post: by
5 posts views Thread by Dave | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.