title: VB.net sending emails
body: <p>I created a form that is recorded into a database and send via email. The form allows itself to be completed once daily and is recorded only once in the database.</p>
  
  <p>I've noticed that sometimes the form arrives twice in the email inbox. </p>
  
  <p>To try and stop this, I created a variable and initialized it to 0. I then allow the code to execute the send command only if the variable is 0. Once the send command executes, I set the variable to 1.</p>
  
  <pre><code>Session("sent") = 0
  If Session("sent") = 0 Then
     smtp.Send(mail)
     Session("sent") = 1
  End If
  </code></pre>
  
  <p>This does not effectively stop the email from arriving twice. The strange thing is that the double send is happening for random people. I'm wondering if the second or 2 that it takes to send the email is enough for folks to click the send button a second time causing the form to get emailed a second time. Maybe I could disable the submit button on the form once it's clicked. Does that sound like a good solution? What else can I try?</p>