Contact Form email help

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
10/20/2009 4:38:17 AM
Gravatar
Total Posts 16

Contact Form email help

Hi,

I have tried to set up a contact form on my mojoportal installations, and none of them work?

this is my setup

windows server 2008

iis 6 simple mail transfer server

sql express

 

Now the strang thing is I have 2 seperate mojo portal intallations, and both reside on the same server and have the same settings in the web.config file, yet one works and the other doesnt?

 

here are my settings:

<add key="DisableDotNetOpenMail" value="false" />

<add key="SMTPServer" value="localhost" />

<add key="SMTPRequiresAuthentication" value="false" />

<add key="SMTPUseSsl" value="false" />

<add key="SMTPPort" value="25" />

<add key="SMTPUser" value="UserName" />

<add key="SMTPPassword" value="UPassword" />

<add key="SMTPTimeoutInMilliseconds" value="30000" />

<!-- leave this blank for ascii encoding -->

<add key="SmtpPreferredEncoding" value="" />

 

 

<mailSettings>

<smtp from="noreply@xxxxxx.co.uk"> host="localhost" port="25" password="" userName="" />

<network

</smtp>

</mailSettings>

Any help as to why one works and the other doesnt would be great!

 Thanks

Ian

 

10/20/2009 6:08:31 AM
Gravatar
Total Posts 18439

Re: Contact Form email help

It's possible that the smtp server is configured to only allow relay from specific ip addresses. If the sites have different ip addresses then perhaps one is not allowed to relay.

Hope it helps,

Joe

10/20/2009 6:15:06 AM
Gravatar
Total Posts 16

Re: Contact Form email help

both copies of mojo are on the same server, with apparently the same settings, and one of them works. This proves the smtp servers ability to work i would have thought.

I am at a bit of a loss?

10/20/2009 6:19:49 AM
Gravatar
Total Posts 18439

Re: Contact Form email help

But do both sites use the same ip address or not?

10/20/2009 6:20:53 AM
Gravatar
Total Posts 16

Re: Contact Form email help

Yes, they are both local to thre smtp server.

10/20/2009 6:22:59 AM
Gravatar
Total Posts 18439

Re: Contact Form email help

That is not what I asked. I get it that they are on the same machine but the machine may have multiple ip addresses and sites may use the same or different ones and the local smtp configuration may allow only specific ip addresses to relay. So one site may be using an ip address allowed to relay and another site may not.

10/20/2009 6:39:06 AM
Gravatar
Total Posts 16

Re: Contact Form email help

ah sorry, I didnt realise what you meant.

There is only 1 IP address with the server, and when i have looked into the bindings they both show the IP address and the domain name.

Is this what you mean? I am not the best with server configuration so sorry if any questions appear a little dumb Laughing

 

 

10/20/2009 6:50:18 AM
Gravatar
Total Posts 18439

Re: Contact Form email help

make sure that in your smtp server configuration, the public ip address of the server is allowed to relay. Note that if the smtp server runs on localhost (which resolves to 127.0.0.1), the public ip address is not seen as local from the perspective of the smtp server, its a remote address. It doesn't know that ip is on the same machine.

Is it possible that in the site where email does not work that you have those settings in more than one place?

ie, if you put the smtp settings from appSettings in a user.config file it will override the settings in Web.config. Also if those settings are listed multiple times in user.config, the settings closer to the bottom of the file will override the settings above.

Hope it helps,

Joe

10/20/2009 6:55:00 AM
Gravatar
Total Posts 16

Re: Contact Form email help

Well I have copied the entire directory of the mojo that works, replacing the one that doesnt, re pointed the connection string and re added the skin, and it still doesnt work.

So either the problem is with IIS configuration, or the database?

 

10/20/2009 7:01:53 AM
Gravatar
Total Posts 18439

Re: Contact Form email help

How do you access the sites, using public urls or localhost?

I think you are not understanding my advice.

On all machines localhost resolves to the loopback address 127.0.0.1.

So a site running at localhost is local to the smtp server running as localhost. Any other url is going to resolve to the public ip address of the server which is not local so the public ip address must explicitly be allowed to relay or the local smtp server will reject it.

Go into IIS right click your smtp server and review properties to make sure the public ip address is listed as allowed to relay.

You may also want to look for errors in the mojoportal log on the site that can't send email. Administration > System Log

Hope it helps,

Joe

10/20/2009 7:16:24 AM
Gravatar
Total Posts 16

Re: Contact Form email help

Ah balls - I was sort of right and it was the database. I hadnt set up a destination email address in the feature instance Undecided

oops!

sorry for wasting your time Joe,  You are a top guy

thanks

Ian

You must sign in to post in the forums. This thread is closed to new posts.