phpmailer sending out 2 emails

  • Answered
User: ctarfq5

I have a form that submits information to a php file. The php takes the information and formats it and sends it off in an email. I am using phpmailer. The initial email is perfect. The second and sometimes third that comes after with no submission on my part is a problem. What is causing the second email, with no form information to be sent?

I am not comfortable posting code, as it has password information. You can assume a classic phpmailer code. I am sending the email to multiple people and with an attachments.

Is there a phpmailer setting that I need to send, or a way to hinder the second email after the first is sent?

Hello Mikecam3, I'm sorry to hear about the problem with the emails. I went through the server to make sure that there was no error that I could find that's causing the problem. There's no visible issue being reported to the error logs. And there is no record of the issue occurring on other accounts. This is a programmatic issue - most likely with phpmailer. I know you're looking for PHPmail setting(s) advice here, but you probably need to add some debugging code so you can determine what's causing the multiple messages since it doesn't appear be server related. I looked for something like this on the web. Check out this link: PHP Mail duplicates - though you did not indicate if the subsequent messages are actually duplicates. Try their suggestion, as it may lead to the answer you're searching for. If you continue to have the problem, we can try to review it again. Any detail at all would help us, so if you could please send more information (e.g. the message was duplicated or this is the URL I'm using) then we would happy to help. Thanks for you patience, please let us know if you require any further assistance! Regards, Arnel C.