More in this section

Forums / Developing with Sitefinity / Newsletter SMTP settings

Newsletter SMTP settings

7 posts, 0 answered
  1. Chris Hofgen
    Chris Hofgen avatar
    10 posts
    Registered:
    28 Jan 2010
    29 Mar 2010
    Link to this post
    Hi,
     
    I have a question. Or two accually :

    First is it possible in any way to get control over the SMTP settings like you have in the de web.config.
    We would like to use a pickupdiretory for the newsletter.

    And secondy: Is it possible to change / customise the mail send methode in the newsletter, for example to add a CC to a newsletter email.

    Greetings,

    Chris Hofgen
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Mar 2010
    Link to this post
    Hi Chris Hofgen,

    1. The SMTP settings are persisted into the database and they are not picked up from the web.condif file. You need to set them through backend UI. Another option is modifying Sitefinity\Admin\ControlTemplates\Notifications\SMTPSettingControlTemplate.ascx and read the settings from the web.config.

    2. Since this is a newsletter group you can add each user in the list. The idea of Newsletter module is not to be used as Mail client as Outlook. Sending a newsletter is made by web service which makes overriding and replacing the base very hard. In such cases it will be easy to create a new simple module that gets the web.config settings and send an email message. You could create some integration between your custom module and newsletter module - say sharing user and groups or sending common emails.

    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.
  3. Chris Hofgen
    Chris Hofgen avatar
    10 posts
    Registered:
    28 Jan 2010
    30 Mar 2010
    Link to this post
    Hi Ivan Dimitrov,

    Thanks for your reponse. But I must say, I do know where to set the SMTP for the newsletter, the problem is where can I set extra mail settings. Like the "deliveryMethod" en so. So by editing the SMTP settings template is no solution also, because on sending the emails the newsletter webservice will read the settings from the database.  So only SMTP host, port and user. Right?

    But NOW the strang thing is, we have specified a "pickupdirectory" in the web.config.

    <smtp deliveryMethod="SpecifiedPickupDirectory" from="noreply@endon.nl">
        <specifiedPickupDirectory pickupDirectoryLocation="C:\inetpub\mailroot\Pickup"/>
    </smtp>        

    On de production server we have a local SMTP, and we see now that the newsletter email are put in the pickup directory.
    But even stranger is?? On my development machine (Vista), where you can not install the MS local smtp. I have specified in the newsletter module our Exchange server. And before yesterday I use the exchange server also in the web.config. But now I have the pickupdirectory specified. The "newsletter" mails are put in this pickup directory, and are not send to the exchange server. So it looks like the newsletter module user still uses partly or only the setting in  the web.config;

    The second think is, and this is why I started this post, when we send the newsletter, it stops after about 2 min's
    And it looks like on this error from the web.service:

    Event code: 3001 
    Event message: The request has been aborted. 
    Event time: 3/30/2010 10:26:32 AM 
    Event time (UTC): 3/30/2010 8:26:32 AM 
    Event ID: 9cc1b7f287614f769b9b3eb5d61342b0 
    Event sequence: 245 
    Event occurrence: 1 
    Event detail code: 0 
       
    Application information: 
        Application domain: /LM/W3SVC/1/ROOT/public-admin-7-129143358638277163 
        Trust level: Full 
        Application Virtual Path: /public-admin 
        Application Path: C:\inetpub\wwwcms_edit\ 
        Machine name: INTER2 
       
    Process information: 
        Process ID: 1988 
        Process name: w3wp.exe 
        Account name: NT AUTHORITY\NETWORK SERVICE 
       
    Exception information: 
        Exception type: HttpException 
        Exception message: Request timed out. 
       
    Request information: 
        Request path: /public-admin/Sitefinity/Admin/Services/MailingWebService.asmx 
        User host address: 77.61.218.21 
        User: adippell 
        Is authenticated: True 
        Authentication Type: Forms 
        Thread account name: NT AUTHORITY\NETWORK SERVICE 
       
    Thread information: 
        Thread ID: 74 
        Thread account name: NT AUTHORITY\NETWORK SERVICE 
        Is impersonating: False 
        Stack trace: 
       
       
    Custom event details: 

    So this is a timeout problem. Right? Where can I set this timeout? 
     
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Apr 2010
    Link to this post
    Hello Chris Hofgen,

    Here is the method that is used for newsletters sending and all parameters that it accepts

    private void StartSendingProcess ( Guid newsletterId, string senderName, string from, string defaultHostEmail, string[ ] toList, string body, string subject, DataManager manager, SmtpClient emailClient )

    These settings are picked up from [sf_Notif_SMTPSetting].

    In its basis the module uses SmtpClient cllass. When initialized the we override only the settings above, so that they are not picked up from the web.config. As you can see we are not overriding any settings regarding PickupDirectoryLocation and the following code is executed by the SmtpClient

    if (MailConfiguration.Smtp.SpecifiedPickupDirectory != null)
       {
           this.pickupDirectoryLocation = MailConfiguration.Smtp.SpecifiedPickupDirectory.PickupDirectoryLocation;
       }

    Most probably this is why the Newsletters module uses your pickup directory .


    Is there any stack of the error you are getting? There must be something that blocks the web service call or some of the subscribers entry is causes issues

    Greetings,
    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. Chris Hofgen
    Chris Hofgen avatar
    10 posts
    Registered:
    28 Jan 2010
    02 Apr 2010
    Link to this post
    Hi Ivan Dimitrov,

    Thanks for you reply.

    About the exception. No, there is no stack I would have include this. This is the message from Sitefinity.log.

    3/30/2010 10:26:32 AM [UNKNOWN]
    ************************************************************************************
    ID: 9cc1b7f2-8761-4f76-9b9b-3eb5d61342b0; Code: 3001; Occurrence: 1; Sequence: 245
    ------------------------------------------------------------------------------------
      
    Application information:
        Machine name: INTER2
        OS Version: Microsoft Windows NT 6.0.6002 Service Pack 2
        Product Version: 3.7.2057.2
        Application Path: C:\inetpub\wwwcms_edit\
        Debug: False
      
    Process information:
        Process ID: 1988
        Process Name: w3wp
      
    Request information:
        Request URL: /public-admin/Sitefinity/Admin/Services/MailingWebService.asmx?WSDL
        Url Referrer:   Is Authenticated: True
        Authentication Type: Forms
        User: adippell
        User Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4200)
        User Address: 77.61.218.21
      
    Variables:
        WebServiceSoapVersion: Soap11
        CmsHttpRequest: /public-admin/Sitefinity/Admin/Services/MailingWebService.asmx?WSDL
        AspSessionIDManagerInitializeRequestCalled: True
        RadControlRandomNumber: 0
      
    - L0 -------------------------------------------------------------------------------
      
    Exception Type: System.Web.HttpException
      
    Message: Request timed out.
      
    Source: 
      
    Stack Trace: 
      
    ------------------------------------------------------------------------------------

    When we look at the email that where send, and looked at the time the first was send and the exception time.
     it after 120 seconds. I could not believe it timed out, and mayby it is a Bug? Because I nowhere found in de documentation or KB artikel somehting changing a timeout setting. But when I did some testing with changing "ASP.Net execution" from I think default it is 120, could be 90 seconds, to 360.  It looked as this would help.
    (Test 3 times with default setting, first went ok, the second and third faild. Then tested 2 times with 360 second setting, both ok)

    In the SMTP queue where two emails which could not be send but I don't believe, or at least these should not be the reason.

    But what I thinks is a bug in the Newsletter module.  Is that when the webservice dies like in our situation.
    And you do a stop - resume. The process does not send the remaining subscribers emails. It say's it does,
    but is does not. 
    And..., and maybe this is a second bug is, you only can stop and resume then in the detail view of the newsletter.
    And Not in the overviews.
      

    Secondly about the pickupdirectory.
    This is great news, it is exactly what we want in the newletter module. In the web.config I set the "SendingInterval" to zero. In our case this works as a charm. The newletter module send from the website is finisched in seconds. It puts all the emails in the pickup directory almost at once. But I must say we are only sending about 200.

    We think it has some advantage.
    - We wont have the problem like before, when the asp process / webservice timeout. And no more sending the
      emails to the remaining subscribers
    - We let the smtp throttle the sending of the emails.
    - If the smpt fails, it will continue sending the remaining emails.

    I must admit that I don't know how it works when you have to send thousand of emails, but I suspect it sill will work.

    Greeting, Chris 
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    05 Apr 2010
    Link to this post
    Hello Chris Hofgen,

    The exection timeout is set for the request and it is general setting in the web. config file.

    <httpRuntime maxRequestLength="1048576" executionTimeout="3600"/>

    I am not able to reproduce any timeout problems testing with 5500 subscribers that received a newsletter. You could take a look at the attached screenshot. Something at your end breaks or blocks the WebService or your server goes temporarily down.

    You may find this KB useful - Newsletters module not sending e-mails

    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.
  7. Chris Hofgen
    Chris Hofgen avatar
    10 posts
    Registered:
    28 Jan 2010
    06 Apr 2010
    Link to this post
    Hi Ivan Dimitrov ,

    Thank you for your reply. As you can read In my reply I figured this out to set the executionTimeout. And yes I can believe you can 5500 subscribers when you timeout setting is one hour. But it is only to bad there is no mention of it in the manuals. Or the in the KB you send me. I had read that one also before.

    Maybe a good idea to update the KB and add the timeout setting. Or put the setting default in de web.config, because now there is nog setting and than the default timeout is 110 seconds. This is what we encountered.
     
    And I think it is maybe something for future release, to be able to recover from a webservice crash and be able to resume. Because can image to have to figure out wiche of the 5500 subscribers you have send a mail and which one's you did'nt. I our case it was only about 200 I had to check out in the smtp log.  

    Thanks again for your help.
Register for webinar
7 posts, 0 answered