J
John McD
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="(e-mail address removed)"; it works.
The query is definitely passing the variable the same value
(I'm displaying it on the screen).
Any suggestions? TIA, John.
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="(e-mail address removed)"; it works.
The query is definitely passing the variable the same value
(I'm displaying it on the screen).
Any suggestions? TIA, John.