E-Mails sent from online form are coming in one single mail

Posted by HasanGursoy on Stack Overflow See other posts from Stack Overflow or by HasanGursoy
Published on 2010-04-20T20:02:48Z Indexed on 2010/04/20 20:13 UTC
Read the original article Hit count: 437

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);

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about email