Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rick van der Meij 35 posts 135 karma points
    Oct 06, 2014 @ 15:46
    Rick van der Meij
    0

    Succesfull Test connection, Error sending 'real' test mail

    Hi,

    we're having a problem with the sendout of a newsletter. We're using the datatype Sendout to send newsletter via the Content Section.

    When testing the connection in general settings, everything is fine, because the testmail is send and received. When I send a test newsletter via the data type i'm getting an error.

    This is all i see when looking at the log. the server doesn't need a username and password and is an intern ip.

    2014-10-06 15:33:33,101 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 39] Begin request: http://xxx.nl/umbraco/backoffice/UmbracoApi/Content/GetById?id=1419.
    2014-10-06 15:33:33,242 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 56] Begin request: http://xxx.nl/umbraco/backoffice/UmbracoApi/Entity/GetAncestors?id=1419&type=document.
    2014-10-06 15:33:35,523 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 39] Begin request: http://xxx.nl/umbraco/backoffice/UmbracoApi/Content/GetById?id=1422.
    2014-10-06 15:33:35,617 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 55] Begin request: http://xxx.nl/umbraco/backoffice/UmbracoApi/Entity/GetAncestors?id=1422&type=document.
    2014-10-06 15:33:35,898 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 14] Begin request: http://xxx.nl/umbraco/backoffice/UmbracoApi/Entity/GetByIds?ids=1421&type=Media.
    2014-10-06 15:33:35,929 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 56] Begin request: http://xxx.nl/umbraco/backoffice/NewsletterStudio/SendContent/GetSendViewModelForNewsletter/.
    2014-10-06 15:33:45,414 [35] DEBUG Umbraco.Web.UmbracoModule - [Thread 55] Begin request: http://xxx.nl/umbraco/backoffice/NewsletterStudio/SendContent/SaveNewsletter.
    2014-10-06 15:33:48,476 [35] INFO  umbraco.BusinessLogic.Log - [Thread 55] Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Error | User: 0 | NodeId: 0 | Comment: Newsletter Studio error in DownloadWebPage()
    
  • Markus Johansson 1608 posts 4535 karma points
    Oct 06, 2014 @ 17:52
    Markus Johansson
    0

    Hi Rick!

    The error message indicates that the page can't be loaded. Do you have a working template defined? Is the page procteded vy roles or something? Using SSL?

    What version of Newsletter Studio are you running? 

    // m

  • Rick van der Meij 35 posts 135 karma points
    Oct 07, 2014 @ 08:43
    Rick van der Meij
    0

    Yes, when i'm using the same template locally, i can use sendgrid to send it then. The page isn't protected by anything. I'm using 2.1.0

  • Markus Johansson 1608 posts 4535 karma points
    Oct 07, 2014 @ 09:13
    Markus Johansson
    0

    Sounds to me that you have some setting on the web server that prevents the code from making a WebRequest. This is what happens when the send out property "renders" the page.

    / m

  • Rick van der Meij 35 posts 135 karma points
    Oct 07, 2014 @ 09:28
    Rick van der Meij
    0

    Can you provide us a sample of the Request, so we can simulate locally?

  • Markus Johansson 1608 posts 4535 karma points
    Oct 07, 2014 @ 09:32
    Markus Johansson
    0

    Hi this is the exact code that runs:

    public class WebPageDownloader
      {
       
      /// <summary>
      /// Returns the content of a given web adress as string.
      /// </summary>
      /// <param name="url">URL of the webpage</param>
      /// <returns>Website content</returns>
      public string DownloadWebPage(string url)
      {
       
      string strWebPage = "";
       
      try
      {
       
      WebRequest objRequest = HttpWebRequest.Create(url);
      HttpWebResponse objResponse;
      objResponse = (HttpWebResponse)objRequest.GetResponse();
       
      string Charset = objResponse.CharacterSet;
      Encoding encoding = Encoding.GetEncoding(Charset);
       
      using (StreamReader sr = new StreamReader(objResponse.GetResponseStream(), encoding))
      {
      strWebPage = sr.ReadToEnd();
      sr.Close();
      }
       
      var charsetParser = new CharsetParser(strWebPage);
      if (charsetParser.HasCharset())
      {
       
      // real charset meta-tag in HTML differs from supplied server header???
      if (charsetParser.GetCharset() != Charset)
      {
       
      Encoding CorrectEncoding = Encoding.GetEncoding(charsetParser.GetCharset());
      WebRequest objRequest2 = HttpWebRequest.Create(url);
       
      HttpWebResponse objResponse2;
      objResponse2 = (System.Net.HttpWebResponse)objRequest2.GetResponse();
       
      using (StreamReader sr = new StreamReader(objResponse2.GetResponseStream(), CorrectEncoding))
      {
      strWebPage = sr.ReadToEnd();
      sr.Close();
      }
       
      }
      }
       
      }
      catch (Exception ex)
      {
      Log.Add(LogTypes.Error, 0, "Newsletter Studio error in DownloadWebPage()" + ex.InnerException);
       
      throw new WebException("Could not load url: " + url + ". Inner exception: " + ex.InnerException);
      }
       
      return strWebPage;
      }
       
      }
     

     

  • Rick van der Meij 35 posts 135 karma points
    Oct 07, 2014 @ 10:18
    Rick van der Meij
    0

    We made a test template with your code. When we render this template with the url of the newsletter the HTML is shown. when we try to send it with the data type we still get the same error

    2014-10-07 10:16:15,649 [14] INFO  umbraco.BusinessLogic.Log - [Thread 19] Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Error | User: 0 | NodeId: 0 | Comment: Newsletter Studio error in DownloadWebPage()
    
  • Rick van der Meij 35 posts 135 karma points
    Oct 07, 2014 @ 10:23
    Rick van der Meij
    0

    Fixed!

    we need to login via http://www.....nl/umbraco instead of http://....nl/umbraco

  • fereta 1 post 21 karma points
    Jan 20, 2015 @ 14:19
  • Nandoh 32 posts 104 karma points
    Mar 30, 2015 @ 11:50
    Nandoh
    0

    Hello Markus,

    I have the same issue as Rick van der Meij. Can you explain us why is this happening? and also why is this "fixed" accessing via "www...."?

    Thanks

  • Markus Johansson 1608 posts 4535 karma points
    Mar 30, 2015 @ 15:20
    Markus Johansson
    0

    Hi!

    I don't really understand your question? Are you also behind some kind of security? The url is based on the url that you configure for that node.

Please Sign in or register to post replies

Write your reply to:

Draft