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

SMTP Mail

I am trying to send SMTP mail:

I have the following code which works fine on one domain, but not on other. It does not work until I remove the Message-ID: line, than it works just fine.

Here's how I removed the Message-ID line:
I stopped the SMTP service (so I could edit the mail file in the Pickup directory), ran the program to send the email, than I edited the file in the Pickup directory and removed the Message-ID line from the message, than restarted the SMTP service. If I leave the line in the file to message disappears from Pickup directory but never arrives at it's destination.

My question: Is there a way I can prevent the program from writing the Message-ID: line? or is there some other setting that I am not aware.



//-------------------- The code ---------------------------------------------------------
MailMessage aMessage = new MailMessage();

aMessage.From = "so*****@somehost.com";

aMessage.To = "so*****@somehost.com";
aMessage.Cc = "";
aMessage.Bcc = "";
aMessage.Subject = "Test";
aMessage.Body = "body";
aMessage.Attachments.Add(new MailAttachment(@"c:\1.txt", MailEncoding.Base64));
SmtpMail.SmtpServer = "";
SmtpMail.Send(aMessage);
//---------------------------------------------------------------------------------
// ---- Here is part of the message ----------------------------------------------

X-Receiver: so*****@somehost.com
X-Sender: so*****@somehost.com
From: <so*****@somehost.com>
To: <so*****@somehost.com>
Subject: Test
Date: Tue, 14 Oct 2003 15:40:21 -0500
Message-ID: <00****************************@somehost.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0001_01C39269.7A17B020"
X-Mailer: Microsoft CDO for Windows 2000
Thread-Index: AcOSk2LFkb/R5J89RPO03O858K66QA==
Content-Class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

This is a multi-part message in MIME format.
--
Thanks
-------------------
cz****@wsinc.com
Nov 15 '05 #1
2 2503
"Peter" <cz****@wsinc.com> wrote in message news:<eR*************@TK2MSFTNGP11.phx.gbl>...
I am trying to send SMTP mail:

I have the following code which works fine on one domain, but not on
other. It does not work until I remove the Message-ID: line, than it
works just fine.

Peter -

When you say "works fine on one domain, but not on other", do you
mean that you can send messages to one domain, but not to another? If
so, I think the problem could be that the one domain is rejecting your
messages based on a Message-ID header field check.

Although not a "standard" header field, some e-mail servers now
check the Message-ID: header field if it is present to ensure that the
domain part of the ID matches a valid domain. It's possible that the
remote mail server is rejecting your messages because you do not have
a valid domain configured on your SMTP server, or because the domain
in the Message-ID field does not match the domain in the From: field
in the message.

I would recommend loading the free WinPcap drivers and using the
Analyzer program (http://analyzer.polito.it) to watch the SMTP session
from your machine. You should be able to see if the remote e-mail
server rejects your message, and why it is rejected. Hope this helps
point you in the right direction.

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html
Nov 15 '05 #2
Thanks for the WinPcap tip!
The problem disapeard after I rebooted the computer - so I don't know what
was the problem and I can't duplicate it now.
"Rich Blum" <ri*******@juno.com> wrote in message
news:cc**************************@posting.google.c om...
"Peter" <cz****@wsinc.com> wrote in message

news:<eR*************@TK2MSFTNGP11.phx.gbl>...
I am trying to send SMTP mail:

I have the following code which works fine on one domain, but not on
other. It does not work until I remove the Message-ID: line, than it
works just fine.

Peter -

When you say "works fine on one domain, but not on other", do you
mean that you can send messages to one domain, but not to another? If
so, I think the problem could be that the one domain is rejecting your
messages based on a Message-ID header field check.

Although not a "standard" header field, some e-mail servers now
check the Message-ID: header field if it is present to ensure that the
domain part of the ID matches a valid domain. It's possible that the
remote mail server is rejecting your messages because you do not have
a valid domain configured on your SMTP server, or because the domain
in the Message-ID field does not match the domain in the From: field
in the message.

I would recommend loading the free WinPcap drivers and using the
Analyzer program (http://analyzer.polito.it) to watch the SMTP session
from your machine. You should be able to see if the remote e-mail
server rejects your message, and why it is rejected. Hope this helps
point you in the right direction.

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html

Nov 15 '05 #3

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

Similar topics

2
by: Mark Carter | last post by:
I'm trying to create a mail server in Twisted. I either get SMTPSenderRefused or SMTPException: SMTP AUTH extension not supported by server. What do I need to do to get it to work?
21
by: Nancy | last post by:
Hi, Guys, Is there any other way to use python or mod_python writing a web page? I mean, not use "form.py/email", no SMTP server. <form action="form.py/email" method="POST"> ... Thanks a lot. ...
2
by: RandRace | last post by:
I'm having some problems with a little script i wrote using net::smtp. I originally wrote it in linux where it works perfectly. I tried to use it from windows the other day and it doesn't work. It...
15
by: Steven Burn | last post by:
My server has POP but only has SMTP if sending to my domain, and not other domains (such as hotmail). I'm therefore wondering, if anyone knows of any scripts etc, that will allow me to have a sort...
3
by: dale zhang | last post by:
Hi, I write an asp.net web application. It has a “Contact Us” page, where users fill in their email, subject and text and hit send. Then the email will go to my hard coded yahoo email...
5
by: Charlie | last post by:
Hi: I'm working on an e-commerce site. Using the SMTP class, my site sends out confirmation messages. It works most of the time, but sometimes raises an error. I need a way of making sure it...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
5
by: Chris | last post by:
I am trying to send email in C#. I wrote 2 pieces of code: 1. MailMessage mail = new MailMessage(); mail.From = "from_address"; mail.To = "to_address"; mail.Subject = "subject"; mail.BodyFormat...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.