I have created a simple code to send emails using the MailMessage class and
the SmtpMail.Send() method:
MailMessage mail = new MailMessage();
mail.From = com; // hard-coded
mail.To = com;
mail.Subject = "Test";
mail.Body = strMessage;
mail.BodyFormat = MailFormat.Html;
It works fine as long as the mail.From address is hard-coded. When I changed
the line to:
string strEmail = txtEmail.Value;
mail.From = strEmail;
txtEmail is an HTML server-control:
<input id="txtEmail" type="text" maxLength="40" size="20" name="txtEmail"
the code stopped working. I mean it does not send emails and even does not
throw any exception!!!
Is there any possibility to ...