473,811 Members | 3,521 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("smt p.myserver.com" )
oClient.Deliver yMethod = SmtpDeliveryMet hod.Network
oClient.UseDefa ultCredentials = False
oClient.Credent ials = New
System.Net.Netw orkCredential(" us******@myserv er.net", "myPassword ")
oMsg = New MailMessage
oFrom = New MailAddress("us ******@myserver .net", "User Name")

oMsg.From = oFrom
oMsg.To.Add("to ****@hotmail.co m")
oMsg.Subject = "Test"
oMsg.Body = "Test"
oClient.Send(oM sg)
Catch ex As Exception
MsgBox(ex.Messa ge)
Finally
If Not oMsg Is Nothing Then
oMsg.Dispose()
End If
oClient = Nothing
GC.GetTotalMemo ry(True)
End Try
Mar 7 '06 #1
0 1183

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

Similar topics

3
1835
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 even though the other addresses are. I know the spelling is correct because I have tried sending messages from my other accounts to this address and have recieved them successfully. I also do not know of any junkmail filter that would delete the...
11
7735
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 the app, even the first time. The application will be required to be sending out repeated emails, about one every second or two. Must this be done asynchronously? Thank you. -Greg I get the generic error messages;
3
2267
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 assertion failure message box. But since this is a remote server, there is no logged in user, so the assertion failure message box is just sitting there waiting forever for someone to come along and hit "OK" button. This is causing problems on the...
4
3583
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 the following code which is very simple. ------------------------snip---------------------------------- Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net") client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials...
2
1993
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 over one of the Static menu items and the menu displays. It moves the entire panel down, the top basically becomes the bottom of the panel...all the information is still intact, but I have a big blank space where my content used to be.... Any...
0
2414
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 when the SMTPClient attaches to the server and the server sends it greeting message, if anything other than +OK is received by the client it throws an exception and falls over.
2
17499
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 the bare minimum: System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("<my mail server IP>", 25); smtp.Send("<one of my email addresses>", "<another of my email addresses>", "Hello", "World");
3
3999
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 do I need to do so that tye mail gets send right away, before I quit my program ? Thanks. SmtpClient smtp = new SmtpClient(); smtp.Host = "relais.videotron.ca"; smtp.Send("guy.harel@xxx.com", "guy.harel@yyy.com", "subject", "body");
1
5170
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 mail sends without error, but html markup is visible in the body of the email. Any suggestions? Code below:
0
9726
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10384
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7667
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6887
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5553
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4338
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.