MailMessage mail = new MailMessage {
From = new MailAddress("[email protected]"),
IsBodyHtml = true,
Subject = topicLists.SelectedItem.Value,
Body = txtMsg.Text
};
// Configuring the SMTP Client
SmtpClient smtp = new SmtpClient() {
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("[email protected]", "to-pass"),
Host = "smtp.gmail.com"
};
// Recipient Address
mail.To.Add("[email protected]");
smtp.Send(mail);
I expect the result should be something like
From: [email protected]
But what I got is that the sender is emailing themselves
From: [email protected]
I don't get why it's not using the other email