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

Emails seemingly disappearing.. very strange problem

I have been tearing my hair out (or indeed, what's left of it) all day
with this one. I'm not sure if it's a .NET issue, a server issue or
anything else and would appreciate any guidance.

Basically, I have a web app that sends emails. Very basic code, nothing
fancy, and I have had it working on about 5 machines! It's hardly worth
pasting, but here's the send method from my email class anyway. As you
can see, very basic:

public void Send(string strTo, string strFrom)
{
if (_strBody != "")
{
// Do replacements here as well as on Compose, so that they can be
added at any time
ReplaceValues();

MailMessage newMailMessage = new MailMessage();
newMailMessage.BodyEncoding = System.Text.Encoding.UTF8;

if (_blnSendAsHTML)
{
newMailMessage.BodyFormat = MailFormat.Html;
}
else
{
newMailMessage.BodyFormat = MailFormat.Text;
}

newMailMessage.To = strTo;
newMailMessage.From = strFrom;

newMailMessage.Subject = strSubject;
newMailMessage.Body = _strBody;
SmtpMail.SmtpServer = strSmptServer;
SmtpMail.Send(newMailMessage);

}
else
{
Debug.Trace.WriteLine("Email body empty; email not sent.");
}

}

Okay, nothing special. Here is the strange problem: If we run it inside
our network here specifying our live server as the SmtpServer, all our
emails are sent fine with no problems.

IF however we deploy the app to our live server with the same
SmtpServer setting (our internet-facing IP) the method fires okay but
we don't get the emails but everything runs okay. No relay errors,
nothing in the trace, nothing appears in the IIS SMTP server log, no
emails go into the Drop or Badmail folders. Nothing at all happens.
I've run through it line-by-line in debug mode and all the properties
get populated with the right value and the SmtpServer send method fires
okay.

I assume this has to be a server configuration issue but I don't have a
clue why this would be working here (using the exact same live server
as SMTP server) but not on the live server. The fact that I'm getting
no errors and nothing from the logs is what's confusing the heck out of
me.

Does anybody have any ideas at all?

Thanks in advance,

Chris

Nov 28 '05 #1
6 1364
"Chris Ashley" <ch***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
IF however we deploy the app to our live server with the same
SmtpServer setting (our internet-facing IP) the method fires okay but
we don't get the emails but everything runs okay. No relay errors,
nothing in the trace, nothing appears in the IIS SMTP server log, no
emails go into the Drop or Badmail folders. Nothing at all happens.
I've run through it line-by-line in debug mode and all the properties
get populated with the right value and the SmtpServer send method fires
okay.


What happens if you telnet to port 25 on the server from the server (within
an RDP window) and try sending an email manually?
Nov 28 '05 #2

Danny Tuppeny wrote:

What happens if you telnet to port 25 on the server from the server (within
an RDP window) and try sending an email manually?


Hi Danny,

Just tried sending an email via telnet from the server itself and it
came through fine. Now I'm even more confused! Any idea?

Cheers,

Chris

Nov 29 '05 #3

Chris Ashley wrote:
Hi Danny,

Just tried sending an email via telnet from the server itself and it
came through fine. Now I'm even more confused! Any idea?

Cheers,

Chris


Just to let people know I have sorted it now. I decided to try COM
interop with the classic CDONTS DLL and it's working fine. Don't have a
clue why though but at least it's sorted now. :)

Chris

Nov 29 '05 #4
"Chris Ashley" <ch***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
What happens if you telnet to port 25 on the server from the server
(within
an RDP window) and try sending an email manually?


Just tried sending an email via telnet from the server itself and it
came through fine. Now I'm even more confused! Any idea?


No :-)

Are you using a different From address? We have hosted servers where mail
sent From domains not hosted with them gets dumped (with no alerts). When
you used telnet, did you definately use the same ip/host to connect as the
script (eg. if the script connects to 123.123.123.123 and you're telnetting
to 127.0.0.1, this may not give a real test).

Nov 29 '05 #5
"Chris Ashley" <ch***********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Just tried sending an email via telnet from the server itself and it
came through fine. Now I'm even more confused! Any idea?


Just to let people know I have sorted it now. I decided to try COM
interop with the classic CDONTS DLL and it's working fine. Don't have a
clue why though but at least it's sorted now. :)


That was my next suggestion ;o)

We seem to have cdonts.dll on most of our 2k3 boxes because someone (not me,
I must add!) must've given up!
Nov 29 '05 #6

Danny Tuppeny wrote:
That was my next suggestion ;o)

We seem to have cdonts.dll on most of our 2k3 boxes because someone (not me,
I must add!) must've given up!


Ho hum. Strange quirks like this make me wonder why I torment myself by
doing this job. :-p

Should have realised that the big difference was that the server was
running 2003 and all our dev machines were running 2000. I guess you
live and learn!

Thanks for the help anyway!

Chris

Nov 29 '05 #7

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

Similar topics

9
by: Larry Woods | last post by:
I have a site that works fine for days, then suddenly, I start getting ASP 0115 errors with an indication that session variables IN SEPARATE SESSIONS have disappeared! First, for background...
3
by: Sander Janssen | last post by:
Hello, I have this peculiar problem concerning MS SQL Server. My company works with an mailing application (ASP) which uses SQL Server as it's repository. What I want to do is send data...
18
by: Heath | last post by:
I also posted this as a reply to another string, I have no idea why? Too much time infront of the pretty blinking screen I suppose. A curious thing is happening, when I use display:inline; and...
1
by: R0bert Neville | last post by:
My web page has one unordered list that disappears in Firefox. The unordered list in question has the class="dir". I double-checked the source code and verified the markup's semantics. Everything...
5
by: lkrubner | last post by:
Except for missing ALT tags on images, this site validates, yet I get some strange disappearing text in IE on a PC. Check out this page: http://www.alexmarshall.org/index.php?pageId=50 At...
1
by: .Net Sports | last post by:
Periodically, my project dll inside the bin folder keeps disappearing (????) , which creates a "Cannot load type myproject.global " error . ????? ..NetSports
4
by: m | last post by:
I have a strange and frustrating problem. page1.aspx asks for a login and goes to itself to validate the login. if it succeeds it creates a cookie for the login and goes to my creditcard form,...
0
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails...
2
by: Mathew Coleman | last post by:
Hi All, I would like to send emails through an application. Body and attachment have to be encrypted as well as digitally signed. I could able to sign it and send when it does not...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.