473,385 Members | 1,641 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,385 software developers and data experts.

SmtpClient.Send() only sends after I quit my appl ?

Guy
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("gu*******@xxx.com", "gu*******@yyy.com", "subject", "body");

May 20 '07 #1
3 3982
* Guy wrote, On 20-5-2007 23:16:
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("gu*******@xxx.com", "gu*******@yyy.com", "subject", "body");
It should send directly. My guess is that it is a compatibility issue
with Norton. Which version of Norton Anti Virus are you using?

Jesse
May 20 '07 #2
Sounds strange to me, like it doesn't send the message until something
has been cleaned up by the garbage collector. Perhaps try creating a
MailMessage object to send the message and dispose of that object
after the send? Use the using( MailMessage message = new
Mailmessage( ... ) ) { } will do that for you. If that doesn't work,
try to enable tracing to see what is going on.

Good luck!

May 21 '07 #3
Guy
I tried de-activating Norton AV, v9.05.15. Same result. I tried the
"using() {}" construct. Same result.
I went into Outlook and configured it to "send/receive" every minute.
After a couple of minutes, the mail goes out, without having to quit
my program.

So, its being queued by Outlook, and not being sent right away.

Thanks.

May 21 '07 #4

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

Similar topics

2
by: nitramsen | last post by:
Hi, I have been using SmtpClient but it seams that it is pretty hard on the SMTP servers it is sending to as it does not send a QUIT command and just closes the socket while the server is wait...
0
by: SR | last post by:
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...
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...
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...
0
by: Frank Carius [MVP] | last post by:
I'm using .NET2.0 Framework and send a message using the SMTPClient from System.Net.Mail to send a message directly (without using Pickup) Everything works fine but i have not found a way to...
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...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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...

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.