Forum Moderators: coopster

Message Too Old, No Replies

Mail is not working

         

MrGecko

9:57 pm on Jun 4, 2007 (gmt 0)

10+ Year Member



i have just installed php 5.0.5 on my server
and mail is not working i also installed send mail 8.13.8 to and it seemed to work

MrGecko

9:58 pm on Jun 4, 2007 (gmt 0)

10+ Year Member



here is php info
phpinfo()

PHP Version => 5.0.5

System => Darwin MrGecko.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh
Build Date => Jun 4 2007 13:43:57
Configure Command => './configure' '--prefix=/Server/php' '--with-xml' '--with-zlib' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-mysql=/usr/local/mysql' '--with-apxs2=/Server/bin/apxs' '--with-config-file-path=/Server/php/conf' '--with-inifile' '--enable-ftp'

sendmail_from => no value => no value
sendmail_path => sendmail -t -i => sendmail -t -i
SMTP => localhost => localhost
smtp_port => 25 => 25

[edited by: eelixduppy at 1:21 pm (utc) on June 8, 2007]
[edit reason] removed excess information [/edit]

coyoteRick

2:28 am on Jun 6, 2007 (gmt 0)

10+ Year Member



I was having problems all day getting the mail() function to work today. I'm quite new to PHP scripting, and learning the ropes... A bit more information on your situation would help to diagnose the problem.

Are you on a local or remote server environment? If you're on a local server environment, your ISP could be bouncing it back, especially if you need to use a login/password every time you login to the SMTP server.

Could you supply a snippet of code on how you're attempting to use the mail() function? You may need additional parameters, depending on your host. Some hosting companies make it a requirement so that they can be certain you're a trusted user. This usually involves using a -f followed by (without a space) your own email address. (example. mail($to, $subject, $message, "-fmyEmail@example.com"); )

Try changing the receiving email address? My problem today was easily fixed when I changed the receiving address of the mail. Turns out the first email address I was testing with actually was stopped by the ISP's spam-blocker.... it was embarrassing I didn't think to do that after scouring the Internet for help. Still, it was worth the learning experience.

Hope that helps some.

[edited by: eelixduppy at 1:04 pm (utc) on June 8, 2007]
[edit reason] changed to example.com (reserved domain) [/edit]

MrGecko

11:49 am on Jun 8, 2007 (gmt 0)

10+ Year Member



i'm using mac os x on my home computer it is local.
<?
@mail("To: myemail@example.com","Test Web Server","Testing","From: myemail@example.com\n", "");
echo "Done";
?>

[edited by: eelixduppy at 1:05 pm (utc) on June 8, 2007]
[edit reason] changed to exmaple.com (reserved domain) [/edit]

eelixduppy

1:03 pm on Jun 8, 2007 (gmt 0)



Is sendmail properly configured on your server? Try changing your code to show errors:

error_reporting(E_ALL);
mail("myemail@example.com","Test Web Server","Testing","From: myemail@example.com\n");

whoisgregg

1:22 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It looks like simply a problem of adding "To: " into the first parameter... It should just be an email address as in eelixduppy's example. (Or a comma separated list of email addresses, see the manual page [php.net] for more details.)

MrGecko

8:38 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



nothing is helping i'm using mac mayb i need a person who did it on mac to help

bkeep

1:18 am on Jun 9, 2007 (gmt 0)

10+ Year Member



This works for me on php 4 and 5


$to_email = tom@example.com;
$subject = "this is a test message";
$body = "This is test body copy for email";
$from_name = "Bob Jones";
$from_email = "bob@example.com";

mail("$to_email", "$subject", "$body", "From: $from_name <$from_email>");

Regards,
Brandon

[edited by: eelixduppy at 6:22 am (utc) on June 9, 2007]
[edit reason] example.com [/edit]

MrGecko

2:49 pm on Jun 9, 2007 (gmt 0)

10+ Year Member



i don't have a problem with the arrangements of the script it is a problem with the server i need a mac user to tell me how they did that

whoisgregg

1:23 pm on Jun 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



MrGecko, I have Mac servers as well. Could you please post the output of running eelixduppy's code from post #3362063 [webmasterworld.com]? If it fails but reports no errors, add one more line, try again, and let us know what you get:

ini_set("display_errors", "Yes");
error_reporting(E_ALL);
mail("myemail@example.com","Test Web Server","Testing","From: myemail@example.com\n");

MrGecko

3:41 pm on Jun 11, 2007 (gmt 0)

10+ Year Member



i received no errors at all the page is blank

whoisgregg

9:27 pm on Jun 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Okay, let's try this code. Before you run it, please edit the
myemail@example.com
to be a valid email address that you can check.

<?php
ini_set("display_errors", "Yes");
error_reporting(E_ALL);
if(mail("myemail@example.com","Test Web Server","Testing","From: myemail@example.com\n")){
echo 'Mail accepted for delivery';
} else {
echo 'Mail was not accepted';
}
?>

MrGecko

11:56 pm on Jun 16, 2007 (gmt 0)

10+ Year Member



it said Mail was not accepted