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


Groups > comp.lang.php > #18605

problem figuring out why mail fails

From bill <william@TechServSys.com>
Newsgroups comp.lang.php
Subject problem figuring out why mail fails
Date 2021-04-13 11:22 -0400
Organization Aioe.org NNTP Server
Message-ID <s54d0b$spc$1@gioia.aioe.org> (permalink)

Show all headers | View raw


I have a script that sends mail in a loop.  Unfortunately it is 
sending only the first.
Mail returns "false" for all sends after the first:

Here is the script segment:
	
	$to ='william@xxxx.com';
	$subject ='IRWOM Status Update request';
	
	$headers[] = 'MIME-Version: 1.0';
	$headers[] = 'Content-type: text/html; charset=iso-8859-1';
	$headers[] = 'From: michigan@xxxxx.org';
// Mail it

	$sent =mail($to, $subject, $message, implode("\r\n", $headers));

//debug info
echo "sent:" . var_dump($sent);

echo basename(__FILE__) . ": " . __LINE__ . ": $appNum<br />";	
print_r (error_get_last());
echo "<br />";
-------------------------

var_dump ($sent) returns bool(false)
error_get_last returns nothing rather than the array expected
If I put an intentional error above the send error_get_last 
correctly reports that.

Does anyone see anything that would generate this or have any 
suggestions for debugging the mail send?

here is the debugging output:
-------------------
statusCheckGenerate.php: 160:
to: william@xxxxx.com
headers: MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: michigan@xxxxxx.org
bool(true) sent:

statusCheckGenerate.php: 160:
to: william@xxxxxxn.com
headers: MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: michigan@xxxxxxx.org
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
From: michigan@xxxxx.org
bool(false) sent:


-bill

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


Thread

problem figuring out why mail fails bill <william@TechServSys.com> - 2021-04-13 11:22 -0400
  Re: problem figuring out why mail fails Jeroen Belleman <jeroen@nospam.please> - 2021-04-13 21:01 +0200
  Re: problem figuring out why mail fails "J.O. Aho" <user@example.net> - 2021-04-13 22:05 +0200
    Re: problem figuring out why mail fails bill <william@TechServSys.com> - 2021-04-16 08:33 -0400
      Re: problem figuring out why mail fails Kristall <kristallin555@gmail.com> - 2023-02-27 02:40 -0800
  Re: problem figuring out why mail fails Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2021-04-13 21:08 +0000
  Re: problem figuring out why mail fails Arno Welzel <usenet@arnowelzel.de> - 2021-04-14 16:32 +0200
    Re: problem figuring out why mail fails Jerry Stuckle <jstucklex@attglobal.net> - 2021-04-14 12:58 -0400
      Re: problem figuring out why mail fails Kristall <kristallin555@gmail.com> - 2023-02-27 02:40 -0800

csiph-web