Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail not working in PHP5 1

Status
Not open for further replies.

lifelineamerica

Programmer
Aug 9, 2006
23
US
I migrated from a shared server that ran PHP 4 to a new one running PHP5.
I'm having trouble sending email as in this simple example:

Code:
<?
$tocust ="me@yoursite.com";
		$mail_contents="This is a test email";
		$subjectcust ="Hello Again!";
		$mailheaderscust ="From:Mysite.com <info@mysite.com>\n";
		$mailheaderscust .="Reply-To:info@mysite.com\n";
		$mailheaderscust .= "MIME-Version: 1.0\n";
		mail($tocust, $subjectcust, $mail_contents, $mailheaderscust);
echo "finished!";
?>

Some parameters in my PHP ini file are as follows:

sendmail_from: sales@getpromo.com
SMTP: localhost
smtp_port: 25

...and PEAR does not appear to be enabled by the way, as I see '--without-pear' in the Configure Command section when I run the php_info() function


So what could be the problem?

 
have you installed a mail transfer agent (e.g. sendmail)? and if so, is it (a) running; (b) offering permissions to the php user; (c) not firewalled at the server level; (d) not firewalled at the host level?

if sendmail is not installed in the normal location and is not available in the PATH you may have to set the location explicitly in your php.ini file. remember to restart the server after changes to php.ini

as an alternative you can use phpmailer with the SMTP option and configure access to a third party MTA like gmail.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top