views:

54

answers:

2

I'm using an online form at one of my web sites. Every mail sent from this form is coming in one mail even if the senders IP is different.

But I want every single mail to be unique even if the content is same. What I need to do to the mails or which header I need to modify?

SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();

MailAddress fromAddress = new MailAddress("[email protected]", "NoReply");
MailAddress toAddress = new MailAddress("[email protected]", "Info");
MailAddress toSender = new MailAddress(tEMail.Text, tNameSurname.Text);

message.From = fromAddress;
message.Bcc.Add(toAddress);
message.ReplyTo = toSender;
message.Subject = tNameSurname.Text + " : contact";
message.IsBodyHtml = true;

message.Body = "some html here";

smtpClient.Send(message);
+2  A: 

What are you using for a mail reader program? Because it sounds like that program is rolling your emails up for you. (Outlook 2010 does this, by default). Try reading your email with a different email reader (like Outlook Express, or tbird)

tgolisch
+2  A: 

Gmail will group emails with the same subject line together. Put some text in the subject line to make it unique, like MessageID, time, whatever.

If you are saying the content in the body contains more than one response, then the issue is how you are collecting the text that then gets assigned to message.Body. If the text is in a variable before assigning to message.Body, make sure that you are not re-using the variable and that it gets re-instantiated each time.

RedFilter
@OrbMan: Problem was caused by grouping. Thank you.
HasanGursoy