Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.06 KB | None | 0 0
  1. MailMessage mail = new MailMessage();
  2. SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
  3. mail.From = new MailAddress("fromxyz@gmail.com");
  4. mail.To.Add("to");
  5. mail.Subject = "subjct";
  6. mail.Body = "email body!!";
  7.  
  8. System.Net.Mail.Attachment attachment;
  9. attachment = new System.Net.Mail.Attachment("filename.extension");
  10. mail.Attachments.Add(attachment);
  11.  
  12. SmtpServer.Port = 587;
  13. SmtpServer.Credentials = new System.Net.NetworkCredential("email id", "password");
  14. SmtpServer.EnableSsl = true;
  15.  
  16. SmtpServer.Send(mail);
  17.  
  18. at Search_Main.Rating_Result.sendIt() in C:UserscloudDesktopdemodemoSearch_Main0Search_MainSearch_MainRating_Result.xaml.cs:line 98
  19. at Search_Main.Rating_Result.ShareTOAll(Object sender, RoutedEventArgs e) in C:UserscloudDesktopdemodemoSearch_Main0Search_MainSearch_MainRating_Result.xaml.cs:line 143
  20. at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
  21. at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
  22. at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
  23. at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
  24. at System.Windows.Controls.Primitives.ButtonBase.OnClick()
  25. at System.Windows.Controls.Button.OnClick()
  26. at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
  27. at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
  28. at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
  29. at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
  30. at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
  31. at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
  32. at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
  33. at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)
  34. at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
  35. at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
  36. at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
  37. at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
  38. at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
  39. at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
  40. at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
  41. at System.Windows.Input.InputManager.ProcessStagingArea()
  42. at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
  43. at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
  44. at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
  45. at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
  46. at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
  47. at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
  48. at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
  49. at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
  50. at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
  51. at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
  52. at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
  53. at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
  54. at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
  55. at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
  56. at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
  57. at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
  58. at System.Windows.Threading.Dispatcher.Run()
  59. at System.Windows.Application.RunDispatcher(Object ignore)
  60. at System.Windows.Application.RunInternal(Window window)
  61. at System.Windows.Application.Run(Window window)
  62. at System.Windows.Application.Run()
  63. at Search_Main.App.Main() in C:UserscloudDesktopdemodemoSearch_Main0Search_MainSearch_MainobjDebugApp.g.cs:line 0
  64. at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
  65. at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  66. at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  67. at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  68. at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  69. at System.Threading.ThreadHelper.ThreadStart()
  70.  
  71. Source="System"**
  72. StackTrace:
  73. at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
  74. at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
  75. at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
  76. at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
  77. at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
  78. at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
  79. at System.Net.Mail.SmtpClient.GetConnection()
  80. at System.Net.Mail.SmtpClient.Send(MailMessage message)
  81.  
  82.  
  83. **InnerException: System.Net.Sockets.SocketException
  84. Message="No connection could be made because the target machine actively refused it 74.125.95.109:587"
  85. Source="System"**
  86. ErrorCode=10061
  87. NativeErrorCode=10061
  88. StackTrace:
  89. at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
  90. at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
  91. at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
  92. InnerException:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement