Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10841

mail working, not working.

From bill <william@TechServSys.com>
Newsgroups comp.lang.php
Subject mail working, not working.
Date 2013-09-23 11:15 -0400
Organization Aioe.org NNTP Server
Message-ID <l1plu1$ien$1@speranza.aioe.org> (permalink)

Show all headers | View raw


In homage to Twane, I have a problem.
This code does not work (mail returns true, but the mail
  is not received):--------------------------------------------
			
	// mail notification to office
	$userx = urlencode($user);
	$emailTo = "office@example.com, william@example.com";
	$message = "A new user registered. ";
	$subject = "A new user registered: $userx";
	$headers = <<<END
From:office@example.com\n
END;
	
  	mail($emailTo,$subject,$message,$headers);
-----------------------------------------------------------

whereas this code does work  (different script)------------
	// now send notification
	// look up email address for msgTo
	$emailTo = fGetEmailAddy($msgTo);
	$name    = fGetRealName ($msgFrom);
	$toName  = fGetRealName ($msgTo);
	
	if ($broadcast)   { // broadcasting a non-clinical message
		$message = stripslashes($msgBody);
		$subject = "General information message from example.";		
		} //broadcasting a non-clinical message

	else   { // not a broadcast message
		$message = "$name left a message for you at 
https://example.com/email/login.php";
		$subject = "The MP Secure Server has a message.";
	    } //not a broadcast message
			  	
	$headers = <<<END
From:office@example.com\n
END;
	mail($emailTo,$subject,$message,$headers);
---------------------------------------------------------------


As far as I can see, they are identical.  But on the other hand, 
maybe I can't see.

Both scripts run on the same server, neither has errors with 
error_reporting(E_ALL); set at the top of the script.
Both require the same class.

in both examples the domain name was changed to "example" by 
hand; otherwise they are copied, pasted, and reformatted to fit news.

Any help and/or suggestions on how to proceed will be 
appreciated.  To make it more fun: earlier in the development 
process both worked just fine.

bill

Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

mail working, not working. bill <william@TechServSys.com> - 2013-09-23 11:15 -0400
  Re: mail working, not working. "Peter H. Coffin" <hellsop@ninehells.com> - 2013-09-23 10:39 -0500
  Re: mail working, not working. Twayne <nobody@spamcop.net> - 2013-09-23 20:16 -0400
    Re: mail working, not working. bill <william@TechServSys.com> - 2013-09-24 06:58 -0400

csiph-web