بســم الله الـرحمــن الرحيــم
السلام عليكــم ورحمـة الله وبركاتــه ،،
قمت بتصميم موقع وطلب واريد عمل صفحة الاتصال بنا وقمت بتصميمها بالفرونت بيج باستخدام النماذج
والمشكلة تظهر رسالة وجود مشكلة مع قرونت بيج سيرفر اكستنشن
مش مهم
قولت ابرمج الصفحة بASP.NET وبعد تصمي الصفحة ووضع النماذج عليها قمت بوضع الكود الاتى بالفيجول بيزيك
Imports System.Net.Mail
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "ahmednet_0001@yahoo.com"
'(1) Create the MailMessage instance
Dim mm As New MailMessage(UsersEmail.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New SmtpClient
smtp.EnableSsl = True
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
End Class
حيث قمت باستخدام الكائنات MailMessage وSmtpClient من الفئة System.Net.Mail وبداخل ملف الكونفيجرايشن وضعت خصائص smtp كالاتى
<system.net>
<mailSettings>
<smtp>
<network host="smtp.gmail.com" port="465" userName="webteset" password="PASSWORD"/>
</smtp>
<!-- Use the following <smtp> settings to have the emails dumped to a directory... -->
<!--
<smtp deliveryMethod="SpecifiedPickupDirectory">
<specifiedPickupDirectory
pickupDirectoryLocation="directoryPath (like C:\MyEmails\)" />
</smtp>
-->
</mailSettings>
</system.net>
حيث اها نفس البيانات التى يحتاجها الاوتلوك لارسال ملف وحيث ان gmail يدعم خدمة smtp المشكلة التى قابلتى بعد رفع الصفعة هى ان الوقت انتهى لتنقيذ العملية
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: The operation has timed out.
Source Error:
Line 20: smtp.EnableSsl = True
Line 21: '(4) Send the MailMessage (will use the Web.config settings)
Line 22: smtp.Send(mm)
Line 23:
السؤال الاول هل البيانات التى وضعتها كافية لعملية ارسال البريد عبر صفحة اى اس بى
والثانى هل هناك دور للشكة المضيفة للموقع
وشكر