You are here: Re: mail() function sending two emails « PHP Programming Language « IT news, forums, messages
Re: mail() function sending two emails

Posted by Sanders Kaufman on 11/24/07 20:18

"Jesse Burns aka jburns131" <jburns131@jbwebware.com> wrote in message
news:J42dncuPMqdeHNXanZ2dnUVZ_hCdnZ2d@comcast.com...

> It's not located in a loop, so I don't understand why it would send 2
> emails to the reciever?
>
> Any idea's?

I had the *exact* same problem - weird as hell, ain't it?
It didn't happen on all pages, just the one - and even stepping through it
in my code editor showed that I was not calling twice.
But still - two friggin mails.

I think it has something to do with the way the server administrator sets up
the mail system.
In my case, sending to a bad email address didn't just return false - it
crashed PHP.
I called the ISP and they immediately "fixed" it, so that bad sends returned
false.
But then - this problem cropped up.

The way I "solved" (for lack of a better word) was to, in that page, not put
the mail() command in a function.
Instead, I put it inline with an if-then.

So... instead of this.
function fnDo() {
mail();
}

I used this:
function fnDo(){
$bDo = true;
}
if($bDo){
mail();
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация