3 Replies - 2022 Views - Last Post: 02 December 2009 - 02:22 PM Rate Topic: -----

#1 impelmedia  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-November 09

PHP mail problems on Linux server - sends to google/yahoo but not othe

Posted 27 November 2009 - 07:05 AM

Hello,
:blink: :crazy:
I have been tearing my hair out all day over this one.... we are currently migrating from a windows web server to a linux box with apache and php 5... however my mail scripts within our websites are causing us big problems! I can send mail to googlemail and yahoo, but if i try to send it to a custom mail server (i.e. our business mailserver) or an email address currently located at our old web server nothing is coming through. I'm not getting any errors when i send the mail though - the response comes back as '1', as in success....well surely no emails coming through means this is a lie?!?!?! I have a feeling it is a server side problem....as the script used to send the mail works for google/yahoo...but here is the code just in case:

	include "/usr/share/php/Mail.php";
		
		$date = date("D, d M Y H:i:s O");
		
		$returnPath = "email@address";

		$from = "email@address";
		
		$to = $_POST['email'];
		
		$subject = "Forgotten Password - New Login Details";
		
		$body = $message;
		
		$host = "localhost";
		
		$username = "username";
		
		$password = "password";
		
		
		$headers = array ('From' => $from,
		
		  'To' => $to,
		
		  'Subject' => $subject,
		  
		  'Date' => $date,
		
		  'Return-path' => $returnPath);
		
		$smtp = Mail::factory('smtp',
		
		  array ('host' => $host,
		
			'auth' => true,
		
			'username' => $username,
		
			'password' => $password));
		
		
		
		$mail = $smtp->send($to, $headers, $body);


Can anyone help?? Obviously we don't want our clients without their mail facilities for very long!

Thanks in advance!

:rolleyes:

Is This A Good Question/Topic? 0
  • +

Replies To: PHP mail problems on Linux server - sends to google/yahoo but not othe

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3100
  • View blog
  • Posts: 10,889
  • Joined: 08-August 08

Re: PHP mail problems on Linux server - sends to google/yahoo but not othe

Posted 27 November 2009 - 09:00 AM

This doesn't sound like it's a php problem. Check your sendmail configuration:
http://www.linuxself...k/sendmail.html
Was This Post Helpful? 1
  • +
  • -

#3 no2pencil  Icon User is offline

  • Admiral Fancy Pants
  • member icon

Reputation: 5395
  • View blog
  • Posts: 27,389
  • Joined: 10-May 07

Re: PHP mail problems on Linux server - sends to google/yahoo but not othe

Posted 27 November 2009 - 09:16 AM

The php mail function will return a success when the mail is sent. It does not check, nor has the ability to check if the mail was received. It is very possible if your reverse DNS settings are not correct, the ISP servers are dropping the email, where Google & Yahoo allow it through, or you've whitelisted the email address & neither Google or Yahoo are even checking it for spam.
Was This Post Helpful? 0
  • +
  • -

#4 codewalkz  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 6
  • Joined: 01-December 09

Re: PHP mail problems on Linux server - sends to google/yahoo but not othe

Posted 02 December 2009 - 02:22 PM

I would rather advise using Phpmailer for a sure delivery of mails.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1