Uradio sam probnu asp.net c# aplikaciju za slanje maila. Na localhost radi odlicno, ali na remote server kada upload-ujem nece da radi .
Ako je neko imao slican problem molim za pomoc.Evo i primera:
u web configu:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="
[email protected]">
<network host="smtp.gmail.com" userName="
[email protected]" password="xxxxxx" port="25" defaultCredentials="false" enableSsl="true"/>
</smtp>
</mailSettings>
</system.net>
I na Default strani :
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.Net.Mail;
using System.Threading;
namespace Default
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SmtpClient smtpClient = new SmtpClient();
smtpClient.EnableSsl = true;
MailMessage msg = new MailMessage();
msg.To.Add("
[email protected]");
msg.Subject = "test";
msg.Body = "test poruka";
smtpClient.Send(msg);
}
}
}
greska koju dobijem izgleda ovako:
Server Error in '/' Application.
A socket operation was attempted to an unreachable network [2a00:1450:400c:c04::6c]:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network [2a00:1450:400c:c04::6c]:25
Source Error:
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 (0x2743): A socket operation was attempted to an unreachable network [2a00:1450:400c:c04::6c]:25]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +464
[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) +6646520
System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) +307
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +19
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +324
System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +141
System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) +170
System.Net.Mail.SmtpClient.GetConnection() +44
System.Net.Mail.SmtpClient.Send(MailMessage message) +1554
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +1906
SmtpTest.SmtpTest.Page_Load(Object sender, EventArgs e) +194
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
Molim za pomoc :-)