Click to See Complete Forum and Search --> : eMail problem well beyond my meager debugging capabilities ....


ThermoSight
March 12th, 2009, 08:54 PM
Hello.

I've encountered an eMail problem well beyond my meager debugging capability. Perhaps you know the answer or have a suggested starting point ....

I have a little C++ .NET (Visual Studio 2003) application which has been working exceptionally well since some time in 2006. This routine sends out email messages (using System::Web::Mail) as per the statement "SmtpMail::Send(pMessage)" whenever an event occurs. Indeed, it normally sends two such messages: one to the individual, and one to the system administrator (Me).

Now, as mentioned a moment ago, this HAD been working flawlessly EVERY DAY since going operational sometime in 2006. EVERY DAY.

However, a week or two ago, just for giggles, I wrote (and continue writing) a new version of the program in C# (Visual Studio 2008) on a second machine on the network. The new version sends email (using System.Net.Mail) via the SmtpClient class - that is, via the statement "client.Send(note)".

I can't say for certain WHEN the problem arose, but suspiciously, sometime around the time the C# program began sending its first such emails, the older version on the Sony Vaio STOPPED sending the email to the individual ... but it CONTINUES, however, to send the email to the administrator.

The network is configured such that both PCs are connected to a router and each finds a connection to the internet thru the router, so it's not like one machine relies on the other for an internet connection.

So, the question is, is it possible that the C# program has somehow affected the email capability of the C++ program on a different machine on the same network, or is that timing just coincidence ?

Is it possible that there is some incompatibility or conflict between the System::Web::Mail and System.Net.Mail, causing one to quit working ? on DIFFERENT machines ?

May I have the benefit of your thoughts ?

Oh! before I leave you with this brain twister, let me impart this thought .... I went into the C++ program with the debugger. The older program *** DOES *** reach the failing SmtpMail::Send(pMessage)" statement. And when that apparently failing statement returns, the program continues on its way thru the next coupla statements to send the Administrator (me) his copy of the message. Two SmtpMail::Send statements are executed within half a dozen lines of each other. The first fails, the second succeeds. EVERY TIME.

NOW may I have the benefit of your suggestions ?

thanks.

Best wishes.

bill

cilu
March 14th, 2009, 08:04 PM
I can't say for certain WHEN the problem arose, but suspiciously, sometime around the time the C# program began sending its first such emails, the older version on the Sony Vaio STOPPED sending the email to the individual ... but it CONTINUES, however, to send the email to the administrator.
Sounds like Skynet it's taking control. ;)

Well, what happens when the first call to SmtpMail::Send fails. You get an exception? What exception? Is it COMException? Can you try using SmtpClient from System.Net.Mail to see if it can succeed? Since you have the code, I guess you can try that.

ThermoSight
March 16th, 2009, 10:54 PM
Cilu,

Thank you so much for your reply, Sir.

In this case, I am ASHAMED to report that the problem wasn't my code at all. The email messages DID go out, but they were held up at the ISP for DAYS. All of a sudden last Saturday evening, out of the blue, the addressee received all seven emails in rapid succession, and since that time, no other emails have been delayed. They have all been received within a very reasonable period from the time they left my machine.

I am ashamed that I led everyone astray on some wild-goose chase where there was no problem. While this problem was ongoing, it was natural for me to assume that the fault was mine. I guess this was one of those very rare instances where my programming was not at fault.

I regret having taken up your time with a non-problem.

My apologies, Sir.

best wishes.

bill

cilu
March 19th, 2009, 05:09 PM
I don't think you have to be ashamed. It was not your fault that all the messages were hold on servers.

bennyboy2
April 29th, 2009, 11:23 AM
Hi, ThermoSight:

I'm currently having trouble getting emails to work at all.
Can you tell me what you use for the host, and possible share some of your working code (preferably the vc++ version)?

I'd really like some info about how to get mail working, because it's been a couple days of trolling already for what I thought would be a pretty simple task.