开发者

regarding sending mail to user

开发者 https://www.devze.com 2023-01-18 08:53 出处:网络
Mai开发者_运维问答lMessage message = new MailMessage(); message.From = new MailAddress(\"admin@mysite.com\");
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);
0

精彩评论

暂无评论...
验证码 换一张
取 消