2011-04-06 15 views
7

कोई कनेक्शन नहीं भेजा जा रहा है क्योंकि लक्ष्य मशीन सक्रिय रूप से इसे 127.0.0.1:25 विवरण से इनकार कर दिया बनाया जा सकता है: वर्तमान वेब अनुरोध के निष्पादन के दौरान कोई बिना क्रिया का अपवाद हो गई। त्रुटि के बारे में अधिक जानकारी के लिए और जहां यह कोड में उत्पन्न हुआ, कृपया स्टैक ट्रेस की समीक्षा करें।एसएमटीपी ईमेल

Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25

स्रोत त्रुटि:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SocketException (0x274d): No connection could be made because the target machine actively refused it 127.0.0.1:25] System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5483819
System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332 System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
System.Net.Mail.SmtpClient.GetConnection() +35 System.Net.Mail.SmtpClient.Send(MailMessage message) +1213

[SmtpException: Failure sending mail.] System.Net.Mail.SmtpClient.Send(MailMessage message) +1531
Checkout.btnSend_Click(Object sender, EventArgs e) +2675
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
I can't send email in live connection but in my local its working.

कृपया मुझे लोग मदद करते हैं।

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

संस्करण जानकारी: Microsoft .NET फ्रेमवर्क संस्करण: 2.0.50727.3615; ASP.NET संस्करण: 2.0.50727.3618

यहाँ मेरी सी # कोड है ..

 SmtpClient SmtpMail = new SmtpClient(); 
     SmtpMail.Host = "localhost"; 

     //delete session cookie 
     Response.Cookies["session"].Expires = DateTime.Now.AddYears(-30); 

     SmtpMail.Send(objEmail); 
+2

पर एक नज़र वहाँ भी आपकी मशीन पर एक मेल सर्वर है है? क्या आपने 'टेलनेट लोकहोस्ट 25' करने का प्रयास किया था? –

+0

आप किस एसएमटीपी सर्वर का उपयोग कर रहे हैं? –

+0

... और अपने (विंडोज़) फ़ायरवॉल ... – m0sa

उत्तर

14

आप उस मशीन पर आपके एसएमटीपी सर्वर शुरू करने के लिए

कृपया मत बताओ आप एक की जरूरत नहीं है भूल गया उस मशीन पर एसएमटीपी सर्वर। लेकिन, अगर आपको लगता है कि यह बताने के लिए है, यह page और this पेज भी

का उल्लेख यहां तक ​​कि अगर आप स्थानीय एसएमटीपी सर्वर को, आपके ईमेल सबसे स्पैम फ़ोल्डर में खत्म हो जाने की संभावना है। अपने ईमेल प्रदाता के एसएमटीपी सर्वर का बेहतर उपयोग करें। जीमेल का प्रयोग करते रहे हैं, तो here

+0

हाँ, लेकिन मेरे मामले में मैं इस एक ही 127.0.0.1:25 त्रुटि के बावजूद SMTP सेवा पर किया जा रहा है, के बावजूद एसएमटीपी सर्वर पर किया जा रहा है और कार्यात्मक मिलता है। यह पहले काम कर रहा था लेकिन शायद कुछ प्रकार की सुरक्षा सेटिंग में बदलाव के कारण अचानक बंद हो गया (लेकिन एसएमटीपी में सेटिंग्स नहीं)। – Dexter

संबंधित मुद्दे