I'm trying to have a method in a page which checks the
database for user's email.
The query populates the variable strEmailTo and then sends
the email:
MailMessage msg = new MailMessage();
msg.To = strEmailTo;
msg.From = strEmailFrom;
msg.Subject = "whatever";
msg.Body = "whatever";
SmtpMail.SmtpServer=strSMTP;
SmtpMail.Send(msg);
However no email is recieved and no error message comes up.
The strange part is that if I hardcode the variable value:
strEmailTo="ju*********@hotmail.com"; it works.
The query is definitely passing the variable the same value
(I'm displaying it on the screen).
Any suggestions? TIA, John.