Mail not sending??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
josh22x
Forum Commoner
Posts: 38
Joined: Tue Feb 26, 2008 11:17 am

Mail not sending??

Post by josh22x »

Hey:

I am having trouble with this PHP mail script.

I have implemented the mail() function in PHP. It seems to be working except for the fact that it will not send the mail. I have been told that I need to change some of the configuration in the php.ini file. However, I am not sure which ones I need to change??

Especially since I am using Unix, do I need to change the: sendmail_path = ?

If so what does it need to be set to?

Secondly, do I need to set any of the other configuration for this function?

Thanks!

Here is the code if needed:

Code: Select all

<?php
 
$name = $_REQUEST['name'];
$last = $_REQUEST['last'];
$email = $_REQUEST['email'];
$comments = $_REQUEST['comments'];
 
$content = "$name $last with an email of: $email made the following comments on your site: $comments";
 
$test = mail('j22cal@aol.com', 'Contact from web viewer', $content);
 
if ($test == true)
{
echo "Email was sent sucessfully";
 }
 else { 
 echo "Email did not submit!!!";
 }
 echo "<br></br>";
?>
 
I do not believe there is anything terribly wrong with the script, but it keeps outputting "Email did not submit!!".

Thanks for your help!
josh22x
Forum Commoner
Posts: 38
Joined: Tue Feb 26, 2008 11:17 am

Re: Mail not sending??

Post by josh22x »

Ok, well it did return true after installing sendmail, which I did not know I had to install, however, the email address that is assigned did not receive any mail??

It is also not in spam. Do you know what could be wrong?

By the way here is the out put of nmap -sT localhost:

PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
3306/tcp open mysql
5900/tcp open vnc
8118/tcp open privoxy

Nmap done: 1 IP address (1 host up) scanned in 0.132 seconds

- Could it be because 25 is not open??

Thanks!
josh22x
Forum Commoner
Posts: 38
Joined: Tue Feb 26, 2008 11:17 am

Re: Mail not sending??

Post by josh22x »

anybody got any ideas?
Post Reply