Mai开发者_运维问答lMessage message = new MailMessage();
message.From = new MailAddress("admin@mysite.com");
Now for fetching email entered by the user in the textbox, I wrote:-
message.To.Add(Convert.ToString(txtEmail));
but this is not working..isn't this the correct way to add email address in "To" ? txtEmail is the textbox's name..Its not giving any error or something..just not working..when I comment out this line of code..the code line next to it works..otherwise code stops working when it encounters this "To.Add " method..plz help..thnx
[edit] I changed it to
message.To.Add(txtEmail.ToString());
still not working
txtEmail.Text
should work.
Try to make it
message.To.Add(txtEmail.Text);
精彩评论