S
SFS
Hello,
I'd like to introduce myself.I have done zero programming since the
days of GWBasic in college. I began using VB.Net 2005 around a month
ago, and even though I've had no formal training, I've found it very
easy to use by looking up docs and examples online, as well as having
found the answers to many of my questions by browsing here. Thanks to
all here! I'm quite sure that my code is not pretty, but it seems to
do the job.
That being said, I have a problem for which I have yet to find a
solution. The follow sub works fine for sending emails from my app,
with the exception that the email is sometimes not sent for two or
three minutes, and in some instances not until another is sent or I
close the app.
Is there a way to "flush" the email cue, or otherwise force the emails
to be sent immediately after this sub is called?
Thanks,
SFS
Sub MailIt(from As String, recipient As String, _
subject As String, body As String, login As String, _
password As String)
Dim mMailMessage As New MailMessage()
Dim client As New SmtpClient("smtp.myhost.com")
client.Credentials = New System.Net.NetworkCredential _
(login, password)
mMailMessage.From = New MailAddress(from)
mMailMessage.To.Add(New MailAddress(recipient))
mMailMessage.Subject = subject
mMailMessage.Body = body
mMailMessage.IsBodyHtml = False
mMailMessage.Priority = MailPriority.Normal
client.Send(mMailMessage)
End Sub
I'd like to introduce myself.I have done zero programming since the
days of GWBasic in college. I began using VB.Net 2005 around a month
ago, and even though I've had no formal training, I've found it very
easy to use by looking up docs and examples online, as well as having
found the answers to many of my questions by browsing here. Thanks to
all here! I'm quite sure that my code is not pretty, but it seems to
do the job.
That being said, I have a problem for which I have yet to find a
solution. The follow sub works fine for sending emails from my app,
with the exception that the email is sometimes not sent for two or
three minutes, and in some instances not until another is sent or I
close the app.
Is there a way to "flush" the email cue, or otherwise force the emails
to be sent immediately after this sub is called?
Thanks,
SFS
Sub MailIt(from As String, recipient As String, _
subject As String, body As String, login As String, _
password As String)
Dim mMailMessage As New MailMessage()
Dim client As New SmtpClient("smtp.myhost.com")
client.Credentials = New System.Net.NetworkCredential _
(login, password)
mMailMessage.From = New MailAddress(from)
mMailMessage.To.Add(New MailAddress(recipient))
mMailMessage.Subject = subject
mMailMessage.Body = body
mMailMessage.IsBodyHtml = False
mMailMessage.Priority = MailPriority.Normal
client.Send(mMailMessage)
End Sub