Asp.Net Mail Gönderme Problemi
-
Local'de email gönderirken herhangi bir sorun yaşamıyorum. Ancak sunucuya publish ettiğimde sorun yaşıyorum.
Email gönderirken kullandığım Kodlar
SmtpClient cli = new SmtpClient();
cli.Host = "mail.domain.com";
cli.Port = 26;
cli.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
cli.Credentials = new NetworkCredential("email adresi", "şifre");
cli.Send(mmessage);
Aldığım hata ise şöyle
Exception information: Exception type: SmtpException Exception message: Failure sending mail. at Application.CirculationEnter(String ChapterRef) at Genel.StatusChange(String appID, String newStatus) at Applicant_ApplicationList.islemeAl_Click(Object sender, EventArgs e) at Telerik.Web.UI.RadButton.OnClick(ButtonClickEventArgs e) at Telerik.Web.UI.RadButton.RaisePostBackEvent(String eventArgument) at Telerik.Web.UI.RadButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Unable to connect to the remote server at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.Send(MailMessage message) A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 174.120.0.158:26 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) -
öncelikle kodlarını daha düzgün yazsaydın daha iyi anlaşılırdı:) sunucunun kullandıgı .net versiyonuyla kendininkini karşılaştır birde sor bakalım smtp haricinde belki bir alternatif kullanmışlardır.Birde port 26 degil 25
-
sandman bunu yazdı:
-----------------------------öncelikle kodlarını daha düzgün yazsaydın daha iyi anlaşılırdı:) sunucunun kullandıgı .net versiyonuyla kendininkini karşılaştır birde sor bakalım smtp haricinde belki bir alternatif kullanmışlardır.Birde port 26 degil 25
-----------------------------
kod bloğunun içi çok doluydu o yüzden ayıkladım biraz, birde üzerine opera ile mesaj gönderdiğimizde oluşan süper mal görüntü eklenince tam olmuş mesaj :) 25 portu türkiyede yasaklı o yüzden 26 yaptım, bendeki netframework ile sunucudaki framework versionları aynı. Sunucuda Win 2008 standart var. Göndermesinde sorun yoktu birden oluştu. Şimdi başka bir yerden bir smtp üzerinden gönderme kod bloğu aldım localde denedim şimdi publish edicem. -
mail portu 26 olmayabilir hosting sağlayıcından bu konuda bilgi alabilirsin.
-
Localse 25. portu kullanabilirsin başka sunucuya yollamak için submission portunu kullanıyorsun 587 ama kullanıcı adı ve şifre ister
Toplam Hit: 1980 Toplam Mesaj: 5
