Forum Moderators: coopster
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]
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]
error_reporting(E_ALL);
mail("myemail@example.com","Test Web Server","Testing","From: myemail@example.com\n");
$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]
ini_set("display_errors", "Yes");
error_reporting(E_ALL);
mail("myemail@example.com","Test Web Server","Testing","From: myemail@example.com\n");
myemail@example.comto 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';
}
?>