473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

System.Net.Mail.SmtpClient Send sends when it wants to

SR
I am using the new namespace in .NET 2.0 to connect to an SMTP server and
send an email message. I am using a Windows Application environment. When
I call the Send function, the message is not sent immediately. It is only
sent when I close the application or try to send another message. I have
tried disabling my AntiVirus package and it still happens or should I say,
doesn't happen. The following is my code, quite simple and from my prior
research, correct.

TIA - Seth

Dim oClient As SmtpClient
Dim oMsg As MailMessage
Dim oFrom As MailAddress

Try
oClient = New SmtpClient("smtp.myserver.com")
oClient.DeliveryMethod = SmtpDeliveryMethod.Network
oClient.UseDefaultCredentials = False
oClient.Credentials = New
System.Net.NetworkCredential("us******@myserver.ne t", "myPassword")
oMsg = New MailMessage
oFrom = New MailAddress("us******@myserver.net", "User Name")

oMsg.From = oFrom
oMsg.To.Add("to****@hotmail.com")
oMsg.Subject = "Test"
oMsg.Body = "Test"
oClient.Send(oMsg)
Catch ex As Exception
MsgBox(ex.Message)
Finally
If Not oMsg Is Nothing Then
oMsg.Dispose()
End If
oClient = Nothing
GC.GetTotalMemory(True)
End Try
Mar 7 '06 #1
0 1161

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nathan Sokalski | last post by:
I have an ASP.NET page that sends a Mail.MailMessage to several email addresses (all mine). However, one of the addresses, the one ending in @verizon.net, does not seem to be recieving the message...
11
by: hazz | last post by:
smtpClient.Send(message) is causing me problems as per specifics in the trace below. Email is sent but not without this error typically upon sending the second email, but sometimes when running...
3
by: ticketdirector | last post by:
Hi, In the event viewer on our production web server (win2k3), I am seeing that if a call to the System.Net.Mail.SmtpClient.Send() function fails / throws an exception, it is popping up an...
4
by: Brian Lorraine | last post by:
I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0 and I love it, but there's just one problem. When it sends an email out, it sends to BOTH the TO and the FROM address. I have...
2
by: SR | last post by:
I have 2 controls that seem to conflict with each other. On my Master page I have a Menu control and on my Content page Panel control. The formatting is great, all fine and dandy, until I hover...
0
by: howardr101 | last post by:
Hi, Have hunted around on the groups and can't find anything, hence. I've tried this against 2 mail servers (mailtraq and hmailserver) and it occus with both. The problems seems to be that...
2
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to...
3
by: Guy | last post by:
I use the following code send mail in my C# application. It works, but it does not send mail immediatly. If I quit my application, then the mail gets send. I can see Norton scan my mail ..etc. What...
1
by: les | last post by:
I'm getting this error "BC30456: 'IsBodyHtml' is not a member of 'System.Net.Mail.SmtpClient'" when trying to submit a form and send email. If I remove the line "MailObj.IsBodyHtml = True" the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.