Email alert when page is open
<p>Is there any way in asp.net that when my page is open on web then an email alert with username should be generate so that i have information that which one is accessing my page</p>

<p>I changed the code like bellow</p>

<pre><code> Public Sub SendMail(ByVal id As String)
        Dim message = New MailMessage()
        message.IsBodyHtml = True
        message.From = New MailAddress("adeel.aslam0@gmail.com")
        message.[To].Add(New MailAddress("malik.adeel@shakarganj.com"))
        message.Subject = "user access page"
        message.Body = "Your Message"
        ' add id here
        Dim client = New SmtpClient("smtp.gmail.com")
        client.Send(message)
    End Sub
</code></pre>

<p>and in web.config like this</p>

<pre><code> &lt;system.net&gt;
    &lt;mailSettings&gt;
      &lt;smtp from="adeel.aslam0@gmail.com"&gt;
        &lt;network host="smtp.gmail.com" defaultCredentials="false"
      port="587" userName ="adeel.aslam0@gmail.com" password="pass" /&gt;
      &lt;/smtp&gt;
    &lt;/mailSettings&gt;
  &lt;/system.net&gt;
</code></pre>
