+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Error on SMTP account saving inNewsletter module

Error on SMTP account saving inNewsletter module

8 posts, 0 answered
  1. marco pessina
    marco pessina avatar
    16 posts
    Registered:
    02 Nov 2009
    16 Mar 2010
    Link to this post
    Hi,
    when I try to save a new SMTP account in the newsletter module I receive this error:


    Server Error in '/' Application.

    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 94.236.99.202:80

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 94.236.99.202:80

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 94.236.99.202:80]
       System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
       System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
       System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224
    
    [WebException: Unable to connect to the remote server]
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy.InvokeWebMethodCall(Boolean async) +340
       Telerik.WebServices.DynamicProxy.WebServiceDynamicProxy.InvokeWebMethodCall() +7
       Telerik.Notifications.Services.MailingServiceProxy.VerifySMTPSetting(String smtpHost, Int32 smtpPort, String smtpUsername, String smtpPassword, Boolean smtpSsL, String msgBody) +153
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.TestCurrentSettings() +372
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.SaveCurrentSetting() +18
       Telerik.Notifications.Newsletters.WebControl.SMTPSettingControl.button_Command(Object sender, CommandEventArgs e) +292
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    

    I also have problems if I save the parameters directly into DB (trying to bypass this error): the newsletter test sending fails. The parameters I'm using are correct, they work both locally and in an another server.

    Could you please give me any advice? Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Mar 2010
    Link to this post
    Hello marco pessina,

    Connected host has failed to respond 94.236.99.202:80

    The error says that the host 94.236.99.202:80 is not responding which cause the Newsletter to fall. Could you check whether the server is up and running at the time when the newsletter is being sent?

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. marco pessina
    marco pessina avatar
    16 posts
    Registered:
    02 Nov 2009
    16 Mar 2010
    Link to this post
    I've hosted the website under IIS using the domain name, not with the IP. The IP Address is not available.

    It is this that is generating the problem? Is there a way to make the saving work with the domain name instead of the IP address?

    It's related to the other problem I have? In order to workaround this smtp saving process error, I've manually added smtp parameters in sf_Notif_SMTPSetting, but the newsletter sending still fails.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Mar 2010
    Link to this post
    Hello marco pessina,

    The error is throw because there is a problem with your SMTP server. The error causes failing of Newsletters web services. I suggest that you should try using another SMTP settings.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. marco pessina
    marco pessina avatar
    16 posts
    Registered:
    02 Nov 2009
    17 Mar 2010
    Link to this post
    Dear Ivan,

    Thank you for the follow up.
    It seems that the problem is not related to the SMTP server.

    What I just noticed in the error was that the WsdlHelper was trying to connect to our external/public IP address but our web server is in a farm and having just checked into it I've found that the routing from the web server to the external facing IP is not available.

    Clients are unable to connect to the Web sites by using the IP address because there is more than one web site configured to the IP address, clients must connect to the Web site by using the host header name. When you attempt to connect to the Web site by using the IP address, you receive the following error message: The page cannot be found.

    So, what I want you to help me to understand is how can I manage this issue.

    Does the MailingServiceWsdl Property should be used in order to set the right address?
    If yes:
    - Any sample about how to set the mailingServiceWsdl property inside the web.config?
    - Should I use the alternate host header (such as <http://internalportal/>)  which only accepts requests from the internal network?

    Could you please give me any advice? Thanks.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    18 Mar 2010
    Link to this post
    Hi marco pessina,

    mailingServiceWsdl property - it is not necessary to set this property in the web.config. The property sets the path to Newsletters web service. ~/Sitefinity/Admin/Services/MailingWebService.asmx?WSDL

    If you want to change the path to the web service you can set the property in the provider declaration

    <notifications defaultProvider="Notifications"  mailingServiceWsdl="SomeService.asmx" >
      <providers>
        <clear/>
        <add name="Notifications" type="Telerik.Notifications.Data.DefaultProvider, Telerik.Notifications.Data" connectionStringName="DefaultConnection" EnableSsl="false" MergedFields="FirstName;LastName" SendingInterval="1000"/>
      </providers>
    </notifications>

    The SMTP hostname reflects the server name and not the senders domain. Also you should be able to configure your mail server to respond on a certain IP so your users could use it and set the newsletters module.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. marco pessina
    marco pessina avatar
    16 posts
    Registered:
    02 Nov 2009
    19 Mar 2010
    Link to this post
    Hi Ivan and thank you for your reply.

    If I understand well the mailingServiceWsdl is not to be considered for solving this issue - but sorry I do not understand again the relationship between SMTP Server and "host has failed to respond 94.236.99.202:80" run-time error.

    Note that the IP address 94.236.99.202 is not my SMTP address but is the IP address for the server running Sitefinity.
    So again, to me "failed to respond 94.236.99.202:80 error" should me connected to an internal error when an internal process/service is trying to connect localhost throw the tcp port 80.

    Do you still confirm me that this issue is connected to a problem with out SMTP server?

    regards,
    Marco.



  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Mar 2010
    Link to this post
    Hello marco pessina,

    Then Newsletter module uses SmtpClient in its basis. The module stores the SMTP settings you have entered in the SMTP form in the database. The module call the server you have entered by IP(name) and tries to send a letter. The error you have posted says that the request to an IP fails. As you can see from the stack the first error is thrown from System.Net.Sockets - used of the Windows Sockets (Winsock) interface to control access to the network.

    The TcpClient, TcpListener, and UdpClient classes encapsulate the details of creating TCP and UDP connections to the Internet.

    The problem you have could be result of
    DNS Routing
    Some proxy settings
    The port is not being open on the server.
    Firewall settings or antivirus solutions blocking traffic.
    Internal policy or permissions - permit WebRequest calls going out from the machine.


    The console application below shows the classes that we use to send a newsletter. You can run it directly over your server. You have to add the required references and generate the executable.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Telerik.Newsletters;
    using System.Net.Mail;
    using Telerik.Notifications.Newsletters;
    using System.Text.RegularExpressions;
    using Telerik.Notifications.Services;
    using System.Net;
      
    namespace TestEmailSettings
    {
        class Program
        {
            static void Main(string[] args)
            {
                string from = "TYPE FROM EMAIL ADDRESS HERE";
                string to = "TYPE TO EMAIL ADDRESS HERE";
                string subject = "test";
                string body = "test SMTP";
                string smtpHost = "TYPE THE HOST IP HERE";
                int smtpPort = 25;
                string smtpUsername = "TYPE THE USERNAME HERE";
                string smtpPassword = "TYPE THE PASSWORD HERE";
                bool smtpSsL = false;
                MailMessage message = new MailMessage(from, to);
                message.Body = body;
      
                SmtpClient emailClient = new SmtpClient(smtpHost, smtpPort);
                emailClient.Credentials = new System.Net.NetworkCredential(smtpUsername, smtpPassword);
                 
                // THIS GETS THE NETWORK CREDETIALS
                //emailClient.Credentials = CredentialCache.DefaultNetworkCredentials;
                //MailMessage m = new MailMessage(from, to, subject, body );
               emailClient.Send(message);
            }
        }
    }



    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
8 posts, 0 answered