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

Posted by Norman Peelman on 11/26/07 11:26

Jerry Stuckle wrote:
> Jesse Burns aka jburns131 wrote:
>> Here's my code:
>>
>> $today = getdate();
>>
>> $to = someone@somewhere.com;
>>
>> $subject = "New Application: ".$userdata["username"]." -
>> ".$today['mon']."/".$today['mday']."/".$today['year'];
>>
>> $message_header = "New Application: ".$userdata["username"];
>>
>>
>> $message = $message_header."\n
>>
>> Hello, is this working?";
>>
>>
>> mail($to, $subject, $message);
>>
>> It's not located in a loop, so I don't understand why it would send 2
>> emails to the reciever?
>>
>> Any idea's?
>>
>>
>>
>
> If it's sending 2 emails, it's because:
>
> a) You are calling the mail() function twice
> b) Your To: header specifies two addresses, or
> c) Your MTA is configured to copy someone automatically.
>
> The most probably reason is you are calling mail() twice.
>

Had the same problem once... it's a good chance that the script is
being called twice. Usually caused by a page reload somewhere else in
the HTML/Javascript. In my case I had a FORM that was getting posted
twice but I can't remember what was causing the page to reload. I think
it was some bad logic in conjunction with a header() call.

Norm

 

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

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