This is a migrated thread and some comments may be shown as answers.

Ooops!:( An error has occurred! message

5 Answers 89 Views
SocialShare
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 14 Apr 2012, 12:34 PM
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?

5 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 2
answered on 16 Apr 2012, 08:12 PM
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?
0
Marin Bratanov
Telerik team
answered on 17 Apr 2012, 12:43 PM
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.
0
Dan
Top achievements
Rank 2
answered on 17 Apr 2012, 04:46 PM
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.
0
Marin Bratanov
Telerik team
answered on 20 Apr 2012, 09:36 AM
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.
0
Zbysek
Top achievements
Rank 1
answered on 05 Jul 2012, 10:34 AM

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.

Tags
SocialShare
Asked by
Richard
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 2
Marin Bratanov
Telerik team
Zbysek
Top achievements
Rank 1
Share this question
or