Ooops!:( An error has occurred! message

6 posts, 0 answers
  1. Richard
    Richard avatar
    14 posts
    Member since:
    Apr 2011

    Posted 14 Apr 2012 Link to this post

    I am attempting to use the RadSocialShare control to allow users of my web site to tell others about the link. I have used the following code:

    <telerik:RadSocialShare ID="RadSocialShare1" runat="server" CssClass="emailwrapper" Skin="Sitefinity" EnableEmbeddedSkins="true" >
    <MainButtons>
    <telerik:RadSocialButton SocialNetType="SendEmail" ToolTip="Email" CustomIconUrl="Images2/product/emailtofriend.png"/>
    </MainButtons>
    </telerik:RadSocialShare>

    I am getting the following message when I attempt to send an email:

    "Ooops!:( An error has occurred!"

    I have got a section in my web.config for

      <system.net>
        <mailSettings>
          <smtp from="customerservices@mywebaddress.com" deliveryMethod="Network">
            <network host="myisprelayserver.net" port="25" defaultCredentials="true" />
          </smtp>
        </mailSettings>
      </system.net>

    These settings work when I send mail in code using SmtpClient.Send() in another part of my application

    Does anyone have any ideas why I might be getting this error?
  2. Dan
    Dan avatar
    25 posts
    Member since:
    May 2008

    Posted 16 Apr 2012 Link to this post

    I've had this exact same problem on our website, both on our development server and in production. Any ideas why it might be happening?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 17 Apr 2012 Link to this post

    Hello guys,

    Please try setting the E-mail settings in the markup of the RadSocialShare (the EmailSettings inner tag). It is possible that for some reason they are not read properly from the web.config.

    I would also advise that you examine the exact response from the server to see what the actual error is. Details on how to accomplish this are available in this thread. As noted in the last post - we use standard .NET classes for the mail functionality, so if the server does not refuse the message there shouldn't be a problem.

    Alternatively, you may look into the MailTo button that uses the client machine's mail client.


    Kind regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Dan
    Dan avatar
    25 posts
    Member since:
    May 2008

    Posted 17 Apr 2012 Link to this post

    Thanks Marin,
    I tried adding the email settings in the RadSocialShare markup as mentioned in the documentation, and the problem persisted. Upon examination in IE9's developer tools, the error returned in the message body was "Object reference not set to an instance of an object", like in the screenshot you posted.
    For our purposes, the MailTo button won't do, so I've just replaced the RadSocialShare's SendEmail button with an older version we used to use, which still works fine. Hopefully the problem will disappear in later versions of RadSocialShare.
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 20 Apr 2012 Link to this post

    Hello Dan,

    Your code uses the standard .NET e-mail classes:
    MailMessage for the message
    SmtpClient for the server
    NetworkCredential for the login
    and the delivery method is SmtpDeliveryMethod.Network

    and I believe the problem stems from server unavailability - i.e. the server may not be responding from this page, with these credentials or with this address. You can review the logs from your server to see if there are any failed connection attempts and you may also check security/firewall settings.


    All the best,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Zbysek
    Zbysek avatar
    7 posts
    Member since:
    Mar 2012

    Posted 05 Jul 2012 Link to this post

    Marin Bratanov: Please try setting the E-mail settings in the markup of the RadSocialShare (the EmailSettings inner tag).

    It is not possible, because I need possibility of change on instalation.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017