Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is email sending slow?

Status
Not open for further replies.

russgreen

Programmer
Dec 7, 2002
86
GB
I have made a real simple email client that works. However, the emaqil is sent but it just takes for ever to get delivered. Why is that? The exact same email sent to the same address through the same servers when sent through Outlook is virtually instant.

My code is below...

TIA
Russ

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim email As New MailMessage
If txtSmtpServer.Text <> &quot;localhost&quot; Then
SmtpMail.SmtpServer = Trim(txtSmtpServer.Text)
End If

email.To = Trim(Me.txtTo.Text)
email.From = Trim(Me.txtFrom.Text)
email.Subject = Trim(Me.txtSubj.Text)
email.Body = Trim(Me.txtBody.Text)
email.BodyFormat = MailFormat.Text
email.Priority = MailPriority.High

Try
SmtpMail.Send(email)
MsgBox(&quot;Email Sent!!!&quot;, MsgBoxStyle.Information)
Catch ex As Exception
MsgBox(&quot;Error!!&quot; + vbLf + ex.Message, MsgBoxStyle.Critical)
End Try
End Sub 'btnSend_Click

Regards,
Russ

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top