Krishna
Krishna

Reputation: 1966

.Net Mail Duplicates

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.

Upvotes: 1

Views: 1454

Answers (3)

Mark Avenius
Mark Avenius

Reputation: 13947

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.

Upvotes: 2

Adrian Godong
Adrian Godong

Reputation: 8921

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>

Upvotes: 2

esteuart
esteuart

Reputation: 1423

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.

Upvotes: 2

Related Questions