J
John McD
When I hardcode a MailMessage To property:
strEmailTo="(e-mail address removed)";
it successfully sends the email.
However, when I read the property from a database query
(strEmailTo =myReader["email"].ToString() it doesn't
send the email and I don't get an error message. The
email just never arrives. I'm displaying the variable
strEmailTo on the screen, so it's definitely set
properly. Any suggestions? The code is below. TIA, John.
strEmailTo =myReader["email"].ToString();
//Email new affiliate
account is now active.\n";
MailMessage msg = new MailMessage();
msg.To = strEmailTo;
msg.From="(e-mail address removed)";
msg.From = strEmailFrom.ToString().Trim();
msg.Subject = "sdffsfdm";//strEmailSubject;
msg.Body = strEmailBody;
SmtpMail.SmtpServer="mail.megapathdsl.net";
SmtpMail.Send(msg);
lblEmailTo.Text=strEmailTo;
strEmailTo="(e-mail address removed)";
it successfully sends the email.
However, when I read the property from a database query
(strEmailTo =myReader["email"].ToString() it doesn't
send the email and I don't get an error message. The
email just never arrives. I'm displaying the variable
strEmailTo on the screen, so it's definitely set
properly. Any suggestions? The code is below. TIA, John.
strEmailTo =myReader["email"].ToString();
//Email new affiliate
account is now active.\n";
MailMessage msg = new MailMessage();
msg.To = strEmailTo;
msg.From="(e-mail address removed)";
msg.From = strEmailFrom.ToString().Trim();
msg.Subject = "sdffsfdm";//strEmailSubject;
msg.Body = strEmailBody;
SmtpMail.SmtpServer="mail.megapathdsl.net";
SmtpMail.Send(msg);
lblEmailTo.Text=strEmailTo;