# Time Ticker when sending email

**URL:** <https://forums.thehomestack.io/t/time-ticker-when-sending-email/203>\
**Category:** vb.Net\
**Created:** [January 13, 2005, 3:36am UTC](https://forums.thehomestack.io/t/time-ticker-when-sending-email/203 "2005-01-13T03:36:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [January 13, 2005, 3:36am UTC](https://forums.thehomestack.io/t/time-ticker-when-sending-email/203/1 "2005-01-13T03:36:45Z")

</div>

Add a Timer and a Label

```auto

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 
        If Label1.ForeColor.Equals(Color.Red) Then 
            Label1.ForeColor = Color.Yellow 
        Else 
            Label1.ForeColor = Color.Red 
        End If 

End Sub 

```

Then under your send button :

```auto

'In your Timer properties window set Enabled to False and Interval to 250 

Me.Label1.Text = "Sending Mail" 
  Timer1.Start() 
            Timer1.Enabled = True 

       Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage 

        oMsg.From = "me@onling.com" 
        oMsg.To = "whoever@yahoo.com" 

        oMsg.Subject = "Test Sending Mail" 
        oMsg.Body = RichTextBox1.Text.ToString 
        Dim oAttch As MailAttachment = New MailAttachment("C:\Backup.zip") 
        oMsg.Attachments.Add(oAttch) 
        SmtpMail.Send(oMsg) 
         
Dim msg As String 
Dim title As String 
Dim style As MsgBoxStyle 
Dim response As MsgBoxResult 
msg = "Your Mail Has Been Sent" 
style = MsgBoxStyle.OKOnly 
title = "Mail Sent Conformation" 
response = MsgBox(msg, style, title) 
If response = MsgBoxResult.OKOnly Then 
   Me.Label1.Text = " " 
 Timer1.Stop() 
            Timer1.Enabled = False 
Else 
    
End If 

```
