الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مشكله فى صفحة اتصل بنا

بدأه Develooper في 3 مارس 2011 · 11 رد · 1,187 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

توجد مشكله فى صفحة اتصل بنا وهى بالفعل تعمل على الجهاز من دون رفعها على السيرفير

وعند رفع الموقع والدخول للصفحه اتصل بنا يظهر خطاء مع انها شغاله وبترسل على الجهاز لكن على السيرفير يطلع خطاء

وللعلم السيرفير على

godaddy

فهل يرفض ارسال الخاص بموقع

gmail

وجربت ال smtp الخاص بسيرفير godaddy واسم المستخدم وكلمه المرورر ولكن لايقبل الارسال

smtpout.asia.secureserver.net

رجاء توضيح سبب المشكله

ولكم جزيل الشكر

===

Web.config

===



<?xml version="1.0"?>

<configuration>

<system.web>
<compilation debug="true" targetFramework="4.0" />
<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
</customErrors>
</system.web>

<system.net>
<mailSettings>
<smtp from="Info@alkhatteeb.com">
<network host="smtp.gmail.com" userName="developerahmed.mohamed852@gmail.com" password="password" port="25"/>
<!--<network host="smtp.gmail.com"/>-->
</smtp>
</mailSettings>
</system.net>

</configuration>

===

Contacts/source html

===


<%@ Page Language="VB" AutoEventWireup="false" Debug="true" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>
To:<br />
<asp:TextBox ID="txtToAddress" runat="server" Columns="35" /></p>
<p>
Subject:<br />
<asp:TextBox ID="txtSubject" runat="server" Columns="50" /></p>
<p>
Body:<br />
<asp:TextBox ID="txtBody" runat="server" Columns="75" TextMode="MultiLine" Rows="6" /></p>
<p>
<asp:Button ID="btnSend" runat="server" Text="Send Mail" style="height: 26px" /> 
<asp:FileUpload ID="FileUpload1" runat="server" /></p>
</div>
</form>
</body>
</html>

===

Contacts/source vb.net

===


Imports System.Net.Mail
Partial Class Default2
Inherits System.Web.UI.Page

Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim Mail As New MailMessage
Mail.From = New MailAddress(txtToAddress.Text)
Mail.To.Add(New MailAddress("developerahmed.mohamed852@gmail.com"))
Mail.Subject = txtSubject.Text
Mail.Body = txtBody.Text
Mail.IsBodyHtml = True

'Dim ImagePath As String = Server.MapPath("images/twitter_icon.png")
'Dim AttachmentImage As New Attachment(ImagePath)
'Mail.Attachments.Add(AttachmentImage)

If FileUpload1.HasFile Then
'Dim msg As New MailMessage("from@here.com", "to@there.com")
'msg.Subject = "File"
'msg.Body = "See file in attachment"
Dim attach As New Attachment(FileUpload1.FileContent, FileUpload1.FileName)
Mail.Attachments.Add(attach)
End If
Dim smtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient("smtp.gmail.com")
smtpClient.Port = " 25"
smtpClient.EnableSsl = True
smtpClient.Send(Mail)
End Sub
End Class

وعند تجربه الارسال على الجهاز يتم الارسال بنجاح لكن السيرفير يظهر خطاء وهو

Server Error in '/' Application.

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 74.125.43.109: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 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 74.125.43.109: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 (0x274c): 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 74.125.43.109:25]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +225
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +279

[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) +6054548
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +314
   System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +322
   System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +146
   System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) +170
   System.Net.Mail.SmtpClient.GetConnection() +50
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1484

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1811
   Default2.btnSend_Click(Object sender, EventArgs e) +430
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   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) +5563

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

#3

اخي مبرمج القاعده

الخطاء ليس فى برمجه صفحة اتصل بنا هى موجوده عندى مثل ما تم توضيح بالكود وتعمل وترسل

وقد جربت الرابط وهو ايضا يرسل بنجاح

ولكن المشكله ان الصفحه تعمل على الجهاز ولكن على النت لا تعمل يظهر خطاء مثل ما تم توضيحه

ما سبب هذه المشكله الصفحه ترسل على الجهاز ولكن عند رفعها على النت لاتعمل على الموقع لا ترسل

ويمكنك تجربت ذالك

http://www.alkhatteeb.com/contactus2.aspx

http://www.alkhatteeb.com/default2.aspx

لك جزيل الشكر

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

#4

يبدو لي أنها مشكلة في الإتصال بسيرفر البريد. هل حاولت التواصل مع الدعم الفني؟

#5

نعم تم التواصل مع الدعم الفنى وفى انتظار الرد

جزاك الله حير

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

#6

أخي العزيز

إذا كان اشتراكك معهم shared Hosting

أتوقع والله أعلم إنك ماتقدر ترسل عن طريق SMTP خارجي

ويلزم عليك أن تستخدم SMTP تبعهم

وهو

relay-hosting.secureserver.net

والسبب اتوقع ليتم معرفة كم عدد الايميل المرسل وحصرها والخ ..

وربنا يعينك..

#7

اخي alrahel

قمت بتغير

SMTP

relay-hosting.secureserver.net

ولكن لم ينجح فى الارسال

وقمت بعمل رساله للشركه ورد عليا انه هذا هو ال

SMTP

ولكن لا يتطلب اسم مستخدم او كلمه مرور وبالفعل لم استخدم اسم المستخدم وكلمه المرور ولكن لم ينجح ايضا فى الارسال فما هيا المشكله

وهذه رساله الشركه

Actually, the correct mail server for use with our Shared Hosting plans is relay-hosting.secureserver.net. This server doesn’t require that you provide authentication, so make sure not to define a username or password.

وهذا ملف الكونفج هل فى خطاء

  <system.net>
    <mailSettings>
      <smtp from="Info@alkhatteeb.com">
        <network host="relay-hosting.secureserver.net"/>
        <!--<network host="smtp.gmail.com"/>-->
      </smtp>
    </mailSettings>
  </system.net>

وهذا كود صفة الارسال

Imports System.Net.Mail
Partial Class Default2
    Inherits System.Web.UI.Page
    Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Dim Mail As New MailMessage
        Mail.From = New MailAddress(txtToAddress.Text)
        Mail.To.Add(New MailAddress("Info@alkhatteeb.com"))
        Mail.Subject = txtSubject.Text
        Mail.Body = txtBody.Text
        Mail.IsBodyHtml = True
        If FileUpload1.HasFile Then
            Dim attach As New Attachment(FileUpload1.FileContent, FileUpload1.FileName)
            Mail.Attachments.Add(attach)
        End If
        Dim smtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient("relay-hosting.secureserver.net")
        smtpClient.EnableSsl = True
        smtpClient.Send(Mail)
    End Sub
End Class

وهذا الخطاء الذى يظهر عند الارسال

Server Error in '/' Application.

Server does not support secure connections.

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.Mail.SmtpException: Server does not support secure connections.

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: 


[SmtpException: Server does not support secure connections.]
   System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +1468591
   System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) +170
   System.Net.Mail.SmtpClient.GetConnection() +50
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1757
   Default2.btnSend_Click(Object sender, EventArgs e) +410
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   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) +5563

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

ولك جزيل الشكر

تم تعديل هذه المشاركة بواسطة Develooper في 4 مارس 2011 في 15:23

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

#8

تم ارسال هذه الرساله من الشركه

I hadn’t notice you were attempting to use SSL with this. Unfortunately, the relay-hosting server doesn’t support SSL, so you will need to disable this.

شكرا جزيلا للجميع

تم تعديل هذه المشاركة بواسطة Develooper في 4 مارس 2011 في 23:02

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

#9

أخي العزيز لاتيأس

وهم قصدهم في الرد الاخير بأن تعمل

smtp.EnableSsl = false;
#10

اخي alrahel

تسلم للتوضيح اصلى ديه تانى مره اتعامل مع صفحت اتصل بنا اول مره مكنش فى اشتراك سيرفير المهم فين وفين لما لاقت الصفحه

تانى مره ترسل على الجهاز والنت لا واكلم الشركه والمنتدى هنا ومفيش بردك كدا خطاء وكدا خطاء قلت خلاص اضيف mail to مش لازم نموذج ارسال

والحمد الله اخيرا اتحلت المشكله الله يكرمك

"لا حياه مع الياس ولا ياس مع الحياه :lol: "

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

#11

أنت بس اعمل هذا الكود خليه false

smtpClient.EnableSsl = false

وجرب ..

لأنه صارت لي نفس المشكله مع جودادي وزبطت معايا..

وانت كمبرمج عاجلا او آجلا حتحتاج أن تعرف الخلل :) ..

وربنا يوفقكـ

#12

تمام اخي alrahel

بالفعل تم عمل الكود مثل ما قلت وتم الارسال بنجاح

الله يوفقنا جميعا :)

لك الحمدُ ،،، على - مَا مضى . .

وَ لكَ الحمدُ ،،، على مَا أنا ، به الآن . .
وَ لكَ الحمدُ ،،، على - مَا سيأتي . .
وَ لكَ الحمدُ ،،، على كُلِ حال . .
الحمد لله على نعمة الاسلام و كفى بها نعمة

مواضيع مشابهة