Double emails being sent from contact form

May 8, 2009 at 9:39 AM

I'm getting an issue where emails sent from the contact form are getting duplicated. The autoresponse is also not getting sent. This is most probably a setting on my side thats not correct but I cannot get to the bottom of it.

My config settings are:

<system.net>
        <mailSettings>
            <smtp>
                <network host="mail.mydomain.org.uk" userName="mail@mydomain.org.uk" password="mypassword"/>
            </smtp>
        </mailSettings>
    </system.net>

CWS settings are:

Email To: mail@mydomain.org.uk

Email From: mail@mydomain.org.uk

The log files are showing 2 entries (2 seconds apart) but the email never gets sent to the email address used in the contact form.

Coordinator
May 8, 2009 at 9:45 AM

It may not like sending the mail from address to be the same as the to address. Could you setup a new account at all?

eg: noreply@... or mailer@ etc... and see if this helps?

As i think this is to do with relay stuff and mail servers.
Warren

Coordinator
May 8, 2009 at 9:46 AM

In regards to the autoresponse not being sent are you using a valid email address in the contact form (hopefully not the same as your Email To and Email From properties) try using a hotmail or a different account for this.

Warren

May 8, 2009 at 10:07 AM

Changing the From: setting to noreply@mydomain.org.uk has resolved the double email issue.

Still not receiving anything to my personal email address that I used in the contact form.

Coordinator
May 8, 2009 at 10:31 AM

Hmm very strange not in a junk email folder?

Is the site available online for me to test with my email address or only in local dev environment?

May 8, 2009 at 10:51 AM
Edited May 8, 2009 at 11:09 AM

I have the site online (launch date is monday !!!), whats the best way to send you a link ?? Don't want to post on here yet.

Scratch that, just tried another work email account and received the autorespond message. For some reason my normal account must be blocking the email.

Thanks for your assistance, I really appreciate the amount of work you've put into this project. I'll send you a link on Monday when we're live (aaaahhhhh !!!)

Coordinator
May 8, 2009 at 11:52 AM

Ah OK great that you found the problem working with email relays and spam filters can be hell at times but i am glad you sorted it so it looks like something to do with that email account.

Cant wait to see how CWS has been modified for a public site.

Warren :)

Mar 27, 2010 at 11:37 PM

Not sure if anyone can help but im having trouble with the double emails as well

so far have tried the following :

left webconig file as is (SMTP BIt) set the email to info@mydomain.co.uk set the email from no-reply@mydomain.co.uk (Results in 2 to the personal email from the form and 2 to the info@ email)

left webconig file as is (SMTP BIt) set the email to info@mydomain.co.uk set the email from info@mydomain.co.uk (same as above)

changed webconig file  SMTP BIt  and set to mail.mydomain.co.uk/ smtp.mydomain.co.uk/ and tried ip address of domain set the email to info@mydomain.co.uk and used the password for mailbox,
then within the form set the email to info@mydomain.co.uk set the email from no-reply@mydomain.co.uk (Results in 2 to the personal email from the form and 2 to the info@ email)

I expect its something simple that need to be changed, but cannot figure it out, have also tried with and with out the SSL option ticked in all above scenarios and if its ticked i get the "server does not support ssl" error

i have also tried replacing the email to with my hotmail address as well

 

any suggestions or help would really be appreicated

 

thanks in advance

Hywel

 

Coordinator
Mar 30, 2010 at 9:14 AM

Sorry for the delay Hywel, this is a project I do in my spare time around work hence the delay.

In regards to SSL error message, this will appear if your SMTP server uses a SSL connection - for example Google Apps SMTP server uses SSL.

Do you have the site online, so I can test the form as an end user to see if I receieve two duplicate thank you emails?

I think the duplicate emails is to do with how you have your email set up. You are sending email with the SMTP server as the email address you want to send the emails to and is probably causing confusion.

I recommend you do the following:

  • Create a new email account on your SMTP server called something like no-reply@mydomain.co.uk
  • Change the web.config SMTP section to use the new email address no-reply@mydomain.co.uk with its username and password
  • In umbraco on the node in the settings tab set "to" email address as info@mydomain.co.uk
  • Set the "from" as no-reply@mydomain.co.uk

Warren

Mar 30, 2010 at 9:19 AM
Cheers warren I think I managed to sort it last night, from what I can make out I don't think I had tried using all my mail settings in the web config file, and having ssl disabled.

Tested a few times last night and it seems to work, thanks again for getting back much appreciated

Sent from my iPhone

On 30 Mar 2010, at 10:14, warrenbuckley <notifications@codeplex.com> wrote:

From: warrenbuckley

Sorry for the delay Hywel, this is a project I do in my spare time around work hence the delay.

In regards to SSL error message, this will appear if your SMTP server uses a SSL connection - for example Google Apps SMTP server uses SSL.

Do you have the site online, so I can test the form as an end user to see if I receieve two duplicate thank you emails?

I think the duplicate emails is to do with how you have your email set up. You are sending email with the SMTP server as the email address you want to send the emails to and is probably causing confusion.

I recommend you do the following:

Warren

Jul 14, 2010 at 12:14 PM
Hello, I am getting this problem with duplicate emails to. Its not the SMTP section in WEB.CONFIG as this looks OK to me. I have a local exchange server on my network to handle SMTP. I have had a problem like this in the past and it was a event handler issues making the routine run twice. Not sure how to check your ContactForm.ascx Would appreciate any ideas to check.
Coordinator
Jul 14, 2010 at 12:19 PM
Hello Darrenst, It is not some kind of relay is it? Please check that you are sending from a physical mailbox folder seperate to say your own address on the exchange, for example. Also have you tried sending to external address say a hotmail or GMail account for example? If you wish to view the source code of the contactform.ascx please see here http://umbracocws.codeplex.com/SourceControl/changeset/view/22882#591176 I hope this helps, and please report back here so I know what the problem was for future reference. Thanks, Warren
Jul 14, 2010 at 12:49 PM
Hi Warren. BTW Great bit of code. I have used a few bits and modified them. OK I have set the Emailto: davisbrent@hotmail.co.uk and the Emailfrom to: enquiry@nine9.co.uk. Both valid. I get 2 emails to davisbrent@hotmail.co.uk and 2 to the Email specified in the Contact variable. In terms of relay, I authorise all traffic from my business subnet to relay in Exchange. Thanks again.
Jul 14, 2010 at 12:51 PM
Oh and my web.config: <system.net> <mailSettings> <smtp from="webmaster@nine9.co.uk"> <network defaultCredentials="true" port="25" host="XXXXX" password="" userName=""/> </smtp> </mailSettings> </system.net>
Coordinator
Jul 14, 2010 at 1:27 PM
Hello Darren Is it maybe because you are trying to send from enquiry@nine9.co.uk in your settings to the form, however in your web config you are saying you want to send it from a different address - webmaster@nine9.co.uk What about if you set it to be webmaster@nine9.co.uk in the umbraco settings? Do you still get duplicated emails?
Jul 14, 2010 at 1:38 PM
Hi Warren, I think I know what is causing the trouble. Its my copy of IE 8, I get single emails from Opera & Firefox I get single emails from my server copy of IE8 Must be something local on my machine. Sincere apologies for wasting you time Warren. PS> Thanks again for the CWS. Its basically got me into Umbraco.
Coordinator
Jul 14, 2010 at 1:41 PM
Not a problem Darren. I am glad that CWS helped you learn and get into Umbraco. If you have any other problems with CWS, please feel free to come back here and discuss it. Warren :)