Question : problem sending email from asp pae

Hi experts,
I have a simple asp.net response form.
See attached code behind(vb)
(correct credentials are provided, I have substituted with XX in the snippet)
No error is generated but email is not sent.
Would appreciate some ideas
rgs
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
Imports System.Net.Mail
Partial Public Class _Default

    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strnam As String = Trim(Request.Form("name"))
        Dim stremail As String = Trim(Request.Form("mail"))
        Dim strcom As String = Trim(Request.Form("com"))
        Dim strsug As String = Trim(Request.Form("sug"))
        Dim Num
        Num = Request.ServerVariables("SCRIPT_NAME")
        Application.Lock()
        Application(Num) = 0
        Application(Num) = Application(Num) + 1
        Application.UnLock()
        If (strnam <> "" And stremail <> "" And strcom <> "" And strsug <> "") Then
            Dim ipadd, brow, msgbody
            ipadd = Request.ServerVariables("REMOTE_ADDR")
            brow = Request.ServerVariables("HTTP_USER_AGENT")
            msgbody = "Suggestions: " & strsug & "Comments: " & strcom & _
              vbCrLf & "PC info:" & "IP:" & ipadd & "Browser: " & brow & _
              "Time:" & Date.Now & "Hits:" & Num & "times!"
            'create the mail message
            Dim eMail As New System.Net.Mail.MailMessage

            'set the addresses
            eMail.From = New MailAddress(stremail)
            eMail.To.Add("XX")

            'set the content
            eMail.Subject = "Feedback From:" & strnam
            eMail.Body = msgbody

            'send the message
            Dim smtp_host As New System.Net.Mail.SmtpClient
            smtp_host.Host = ("XX")
            smtp_host.Port = 25
            smtp_host.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
            smtp_host.Credentials = New System.Net.NetworkCredential("XX", "XX")
            smtp_host.Send(eMail)
           
        End If
    End Sub

End Class

Answer : problem sending email from asp pae

Ensure that your ANTI Virus / Firewall might be blocking this operation , try again after disabling the mentioned ..  
Random Solutions  
 
programming4us programming4us