Hi Guys, I'm having a troubling problem. I have an install of umb 3 working fine sending mail with a simple control. Before I upload the code I'll explain the problem.
It sends fine on UMB3 but on UMB 4 with identical smtp ect, the script runs but the email goes straight to the queue folder.
Problem solved and it's nothing to do with umbraco. I have not authenticated the server as a mailserver and the test email address was simply rejecting the mail.
Frustrating SMTP problems... umb 4 on server 2003
Hi Guys, I'm having a troubling problem. I have an install of umb 3 working fine sending mail with a simple control. Before I upload the code I'll explain the problem.
It sends fine on UMB3 but on UMB 4 with identical smtp ect, the script runs but the email goes straight to the queue folder.
The code is as such..
<%@ Control Language="VB" ClassName="ContactForm" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
Private _EmailTo, _EmailSubject
Public Property EmailTo()
Get
Return _EmailTo
End Get
Set(ByVal value)
_EmailTo = value
End Set
End Property
Public Property EmailSubject()
Get
Return _EmailSubject
End Get
Set(ByVal value)
_EmailSubject = value
End Set
End Property
Protected Sub FeedBackButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strtxtName, strtxtCompany, strtxtAddress, strtxtPostaltown, strtxtCountry, strtxtTelno, strtxtEmail, strtxtComments As String
strtxtName = txtName.Text
strtxtCompany = txtCompany.Text
strtxtAddress = txtAddress.Text
strtxtPostaltown = txtPostaltown.Text
strtxtCountry = txtCountry.Text
strtxtTelno = txtTelno.Text
strtxtEmail = txtEmail.Text
strtxtComments = txtComments.Text
Dim strEmailFrom, strEmailTo, strEmailSubject As String
strEmailTo = EmailTo
strEmailSubject = EmailSubject
Dim mm As New MailMessage(strtxtEmail, strEmailTo)
mm.Subject = strEmailSubject
mm.Body = strtxtName & vbCrLf & vbCrLf & strtxtCompany & vbCrLf & vbCrLf & strtxtAddress & vbCrLf & vbCrLf & strtxtPostaltown & vbCrLf & vbCrLf & strtxtCountry & vbCrLf & vbCrLf & strtxtTelno & vbCrLf & vbCrLf & strtxtEmail & vbCrLf & vbCrLf & strtxtComments
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
EmailSentForm.Visible = True
EmailForm.Visible = False
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
EmailSentForm.Visible = False
End If
End Sub
</script><asp:Panel runat="server" ID="EmailForm">
<asp:ValidationSummary ID="ValidationSummary" runat="server" CssClass="Error" ForeColor="" HeaderText="Please correct the following problems" />
<fieldset style="padding:10px;" >
<p style="padding-top:10px;">
<asp:TextBox ID="txtName" runat="server" ToolTip="Please enter your name." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Contact Name<asp:RequiredFieldValidator ID="RequiredName" runat="server" ErrorMessage="Please enter your name." ToolTip="Please enter your name." ControlToValidate="txtName" CssClass="ErrorStar" Display="Dynamic">*</asp:RequiredFieldValidator></label>
</p>
<label for="ContactForm3_txtName">
<p>
<label for="ContactForm3_txtCompany">
<asp:TextBox ID="txtCompany" runat="server" ToolTip="Please enter your company where applicable." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Company</label>
</p>
<p>
<label for="ContactForm3_txtAddress">
<asp:TextBox ID="txtAddress" runat="server" ToolTip="Please enter your address." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Address</label>
</p>
<p>
<label for="ContactForm3_txtPostaltown">
<asp:TextBox ID="txtPostaltown" runat="server" ToolTip="Please enter your postal town." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Postal town</label>
</p>
<p>
<label for="ContactForm3_txtCountry"><asp:TextBox ID="txtCountry" runat="server" ToolTip="Please enter your Country." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Country</label>
</p>
<p>
<label for="ContactForm3_txtTelno">
<asp:TextBox ID="txtTelno" runat="server" ToolTip="Please enter your telephone number." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Tel No</label>
</p>
<p>
<label for="ContactForm3_txtEmail">
<asp:TextBox ID="txtEmail" runat="server" ToolTip="Please enter your email address." CssClass="umbSignUpText" Width="160px"></asp:TextBox>
Email:<asp:RequiredFieldValidator ID="RequiredEmail" runat="server" ErrorMessage="Please enter your email address." ToolTip="Please enter your email address." ControlToValidate="txtEmail" CssClass="ErrorStar" Display="Dynamic">*</asp:RequiredFieldValidator><asp:RegularExpressionValidator ID="RegularExpressionEmailValidator" runat="server" ErrorMessage="Please enter a valid email address." ToolTip="Please enter a valid email address." ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ControlToValidate="txtEmail" CssClass="ErrorStar" Display="Dynamic">*</asp:RegularExpressionValidator>
</label>
</p>
<p>
<asp:TextBox ID="txtComments" Height="75px" Width="160px" runat="server" TextMode="MultiLine" ToolTip="Please enter your message" CssClass="umbSignUpText"></asp:TextBox>
<label for="ContactForm3_txtComments">Comments:<asp:RequiredFieldValidator ID="RequiredMessage" runat="server" ErrorMessage="Please enter your message." ToolTip="Please enter your message." ControlToValidate="txtComments" CssClass="ErrorStar" Display="Dynamic">*</asp:RequiredFieldValidator>
</label>
</p><br/>
<p style="clear:both; padding-top:10px;">
<asp:Button ID="FeedBackButton" runat="server" OnClick="FeedBackButton_Click" Text="Send Enquiry" CssClass="umbSignUpText" />
</p>
</fieldset>
</asp:Panel>
<asp:Panel runat="server" ID="EmailSentForm">
<h5>Your enquiry has been sent... thank you!</h5>
</asp:Panel>
How's the web.config configured? Can you paste that snippet?
Cheers,
/Dirk
<system.net>
<mailSettings>
<smtp>
<network host="127.0.0.1" />
</smtp>
</mailSettings>
</system.net>
I removed all passwords for the tests so I could narrow it down.
Here's the whole thing sans db login :)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<section name="urlrewritingnet" restartOnExternalChanges="true" requirePermission="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
<!-- ASPNETAJAX -->
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="umbraco.presentation.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<urlrewritingnet configSource="config\UrlRewriting.config" />
<appSettings>
<add key="umbracoDbDSN" value="server=SERVER;database=DATABASE;user id=USER;password=PASS" />
<add key="umbracoConfigurationStatus" value="4.0.2.1" />
<add key="umbracoReservedUrls" value="/config/splashes/booting.aspx,/install/default.aspx,/config/splashes/noNodes.aspx" />
<add key="umbracoReservedPaths" value="/umbraco,/install/" />
<add key="umbracoContentXML" value="/data/umbraco.config" />
<add key="umbracoStorageDirectory" value="/data" />
<add key="umbracoPath" value="/umbraco" />
<add key="umbracoEnableStat" value="false" />
<add key="umbracoHideTopLevelNodeFromPath" value="true" />
<add key="umbracoEditXhtmlMode" value="true" />
<add key="umbracoUseDirectoryUrls" value="false" />
<add key="umbracoDebugMode" value="true" />
<add key="umbracoTimeOutInMinutes" value="20" />
<add key="umbracoVersionCheckPeriod" value="7" />
<add key="umbracoDisableXsltExtensions" value="true" />
<add key="umbracoDefaultUILanguage" value="en" />
<add key="umbracoProfileUrl" value="profiler" />
<add key="umbracoUseSSL" value="false" />
<add key="umbracoUseMediumTrust" value="false" />
</appSettings>
<!-- This Replaces the old umbracoSmptpServer config-->
<system.net>
<mailSettings>
<smtp>
<network host="127.0.0.1" />
</smtp>
</mailSettings>
</system.net>
<system.web>
<customErrors mode="RemoteOnly" />
<trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
<xhtmlConformance mode="Strict" />
<pages enableEventValidation="false">
<!-- ASPNETAJAX -->
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add tagPrefix="umbraco" namespace="umbraco.presentation.templateControls" assembly="umbraco" />
</controls>
</pages>
<httpModules>
<!-- URL REWRTIER -->
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
<!-- UMBRACO -->
<add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
<add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
<!-- ASPNETAJAX -->
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<!-- ASPNETAJAX -->
<add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<!-- UMBRACO CHANNELS -->
<add verb="*" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
<add verb="*" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
</httpHandlers>
<compilation defaultLanguage="c#" debug="false" batch="false">
<assemblies>
<!-- ASPNETAJAX -->
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms name="yourAuthCookie" loginUrl="login.aspx" protection="All" path="/" />
</authentication>
<authorization>
<allow users="?" />
</authorization>
<!-- Membership Provider -->
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
<add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
</providers>
</membership>
<!-- added by NH to support membership providers in access layer -->
<roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
<providers>
<clear />
<add name="UmbracoRoleProvider" type="umbraco.providers.members.UmbracoRoleProvider" />
</providers>
</roleManager>
<!-- Sitemap provider-->
<siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true" />
</providers>
</siteMap>
</system.web>
<!-- ASPNETAJAX -->
<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="true" enableCaching="true" />
</scripting>
</system.web.extensions>
<applicationSettings>
<umbraco.presentation.Properties.Settings>
<setting name="umbraco_com_regexlib_Webservices" serializeAs="String">
<value>http://regexlib.com/WebServices.asmx</value>;
</setting>
</umbraco.presentation.Properties.Settings>
</applicationSettings>
<!-- IIS 7 Integrated Mode Configuration
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
<add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
<add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers accessPolicy="Read, Write, Script, Execute">
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<remove name="Channels"/>
<remove name="Channels_Word"/>
<add verb="*" name="Channels" preCondition="integratedMode" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
<add verb="*" name="Channels_Word" preCondition="integratedMode" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
</handlers>
</system.webServer>
-->
</configuration>
Problem solved and it's nothing to do with umbraco. I have not authenticated the server as a mailserver and the test email address was simply rejecting the mail.
is working on a reply...