473,659 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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*****@someho st.com";

aMessage.To = "so*****@someho st.com";
aMessage.Cc = "";
aMessage.Bcc = "";
aMessage.Subjec t = "Test";
aMessage.Body = "body";
aMessage.Attach ments.Add(new MailAttachment( @"c:\1.txt", MailEncoding.Ba se64));
SmtpMail.SmtpSe rver = "";
SmtpMail.Send(a Message);
//---------------------------------------------------------------------------------
// ---- Here is part of the message ----------------------------------------------

X-Receiver: so*****@somehos t.com
X-Sender: so*****@somehos t.com
From: <so*****@someho st.com>
To: <so*****@someho st.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.7 A17B020"
X-Mailer: Microsoft CDO for Windows 2000
Thread-Index: AcOSk2LFkb/R5J89RPO03O858K 66QA==
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.co m
Nov 15 '05 #1
2 2549
"Peter" <cz****@wsinc.c om> wrote in message news:<eR******* ******@TK2MSFTN GP11.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.goo gle.com...
"Peter" <cz****@wsinc.c om> wrote in message

news:<eR******* ******@TK2MSFTN GP11.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
7935
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
3366
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. Nancy W
2
13700
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 connects to the server and prints the banner but will not send mail. Here is my script: use Net::SMTP; my $smtp = Net::SMTP->new('smtp.comcast.net') or die "Can't Open server"!";
15
3064
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 of "virtual" SMTP server on my site?. (I really can't afford to use a third party SMTP mailer). -- Regards Steven Burn
3
5566
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 account. I was using optimum online service with smtp server as “mail.optonline.net”. I can receive email correctly. Now I switch to verizon DSL. I change my smtp server accordingly as
5
2495
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 goes out every time. I thought about wrapping a try-catch handler in loop that keeps on retrying if delivery fails. Is this a good idea? If not, what is the best way of handling this kind of thing? Thanks,
3
3025
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 identifies itself as the computer name which is not in domain.com format, triggering spam filter problems). Instead, I want to have my code send through an SMTP server of a company that we pay for mail service. But they require a username and password....
34
18222
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 "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
5
23753
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 = MailFormat.Text; mail.Body = "body"; SmtpMail.SmtpServer = "smtp.server"; mail.Fields.Clear();
7
7730
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 free edition for anti-virus. I use an ISP provider from my country and according to them I do not need to perform authentication while sending mails through their SMTP address. Thus I am using external SMTP server. I don't have IIS installed...
0
8332
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
8851
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
8746
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...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
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
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.