views:

31

answers:

3

Hello everybody, I am facing a weird problem in production, not happening in Local machine.

I hosted an application in godaddy that has a aspx page where it collects the email addresses from the text fields (txtTOEmail,txtCCEmail, txtBCCEmail).

When I call the send method on the mail object, the mail is sent twice. But this is not happening in my local machine.

NOTE : In my local machine I am using GMAIL smtp. In prod I am using Godaddy SMTP.

Any ideas and advices are welcomed.

Thanks in advance.

+1  A: 

Are you using the same email for more than one of the fields? If so, it could be a difference in how GMail sends vs. how Godaddy sends. GMail probably notices the two email addresses are the same and only sends one email. Godaddy may not check that.

esteuart
You guys are right, there is a piece of code that adds the email address twice if a condition is matched in the base class. I figured it out. Thanks for the help.
Krishna
A: 

For starters, you can dump the e-mail to a folder instead of sending it to the SMTP server to see if you actually send it twice:

  <system.net>
    <mailSettings>
      <smtp deliveryMethod="SpecifiedPickupDirectory" from="[from address]">
        <specifiedPickupDirectory pickupDirectoryLocation="[dump directory]" />
      </smtp>
    </mailSettings>
  </system.net>
Adrian Godong
+2  A: 

Can you show the code that is sending the email? It is possible that GMail is consolidating two of the same address into one email instead of sending it twice.

Mark Avenius
Unfortunately, I dont have that code with me now. I will post it soon.
Krishna
You guys are right, there is a piece of code that adds the email address twice if a condition is matched in the base class. I figured it out. Thanks for the help.
Krishna
You're welcome. Glad to be a help.
Mark Avenius