Home All Groups Group Topic Archive Search About

SmtpMail.Send creates duplicated Message-ID (repost)

Author
12 Jan 2005 1:13 AM
Michael Leung
This is the second post as a subscriber to a managed group because to
previsous one do not have any response. Sorry for that because it is really
urgent!!!!

I use SmptMail.Send everywhare in my Windows 2000 server running
dotnet 1.1, including console C# scheduled tasks, SQL Server DTS and
ASP.NET. The coding is simple and strictforward (attached below).

When more and more applications are running on the server, I found
that some emails are missing recently. Below is the SMTP log, which
revealed that more than one processes are calling smtpmail.send at the
same time and smtp just produced DUPLICATED MESSAGE-IDs. Of course,
our email system will filter duplicated emails. The log has two HELO
before QUIT and the message ID "003101c4f3cf$84dfb610$0cfea...@dcscs2"
is duplicated. The third HELO and QUIT is normal with a different
message-id.


After I stopped the routing and repeat, I can find two EML files in
the DROP folders having the same message id.


Any experienced developers please help.


Thanks,
Michael Leung


**** SMTP LOG ****
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 HELO

- +dcscs2 250 0 38 11 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 MAIL

- +FROM:+<From> 250 0 37 17 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 RCPT

- +TO:+<CDD.CS.MLE***@HEH.NET> 250 0 34 32 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 RCPT

- +TO:+<CDD.CS***@HEH.NET> 250 0 30 28 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 HELO

- +dcscs2 250 0 38 11 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 MAIL

- +FROM:+<FROM> 250 0 37 17 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 DATA

- +<003101c4f3cf$84dfb610$0cfea...@dcscs2> 250 0 123 479 0 SMTP - - -
-
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 QUIT
- dcscs2 240 0 63 4 0 SMTP - - - -

2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 RCPT


- +TO:+<CDD.CS.MLE***@HEH.NET> 250 0 34 32 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 RCPT

- +TO:+<CDD.CS***@HEH.NET> 250 0 30 28 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 DATA

- +<003001c4f3cf$84dfb610$0cfea...@dcscs2> 250 0 123 479 15 SMTP - - -
-
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 QUIT
- dcscs2 240 15 63 4 0 SMTP - - - -

2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 HELO

- +dcscs2 250 0 38 11 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 MAIL

- +FROM:+<FROM> 250 0 37 17 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 RCPT

- +TO:+<CDD.CS.MLE***@HEH.NET> 250 0 34 32 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 RCPT

- +TO:+<CDD.CS***@HEH.NET> 250 0 30 28 0 SMTP - - - -
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 DATA

- +<003101c4f3cf$84e47100$0cfea...@dcscs2> 250 0 123 479 0 SMTP - - -
-
2005-01-06 09:10:08 127.0.0.1 dcscs2 SMTPSVC2 DCSCS2 127.0.0.1 0 QUIT
- dcscs2 240 0 63 4 0 SMTP - - - -

//*** sample coding in sending mail ***
String sAttach;
MailMessage message = new MailMessage();
message.To = To.Text;
message.Cc = cc.Text;
message.From = From.Text;
message.Subject = Subject.Text;
message.BodyFormat = MailFormat.Text;
message.Body = Message.Value;
SmtpMail.SmtpServer = Mailserver.Text;
sAttach = Attachments.Text;
if (sAttach != "") {


        char[] delim = new char[] {','};
        foreach (string sSubstr in sAttach.Split(delim))
        {
           MailAttachment myAttachment = new MailAttachment(sSubstr);
           message.Attachments.Add(myAttachment);
        }

}


SmtpMail.Send(message);

AddThis Social Bookmark Button