Page 1 of 1

mail scripts won't work

Posted: Wed Jun 16, 2010 1:12 pm
by goltoof
I've been tearing my hair out for 3 days now over something that some 12 year old could probably do in 10 minutes in his sleep.

My Joomla site sends mail just fine, but I can't even get the simplest php script to send mail. By simplest I mean

Code: Select all

<?php
$txt = "Some text";

mail ("my@email.com","Test subject",$txt);
?> 
I'm using Ubuntu server, sendmail is all configured. Joomla sends just fine, I'm trying to send from a simple form on a webpage outside of Joomla which brings me to believe that there's something I'm not including in the script that it needs to work.

Can you break down each thing that I should check on the server and each thing I should include in the script to just make it work?

Re: mail scripts won't work

Posted: Wed Jun 16, 2010 1:31 pm
by internet-solution
To start with, check the return value from mail()

Code: Select all

$mailReturn=mail ("my@email.com","Test subject",$txt);
echo $mailReturn;
and post the result here.

Re: mail scripts won't work

Posted: Wed Jun 16, 2010 1:42 pm
by goltoof
internet-solution wrote:post the result here.
1

Re: mail scripts won't work

Posted: Wed Jun 16, 2010 1:48 pm
by internet-solution
Then the mail is accepted for delivery. Use 'mailq -v' in ubuntu shell to check mail que. If nothing in the que then check your spam folder.