c# - Access Email Address from DetailView -


I am trying to access the email address in DetailsView , but getting this error textbox email address = this. Delivery view 1. Fund control ("email") as text box; String myemail = EmailAddress.Text; System.Net.Mail.MailMessage Mail Message = New System.Net.Mail.MailMessage (); MailMessage.From = New System.Net.Mail.MailAddress (System.Configuration.ConfigurationManager.AppSettings ["From Email Address"]); MailMessage.To.Add (New System.Net.Mail.MailAddress ("myemail")); // error

Therefore, the code is stopping on this line and I have received the error:

  mail message. To add (new system .net.mail.mailAddress ("myemail"));    

I can not help but note that the "myemail" quote in your code Has:

  mail message. To add (new system.net.mail.mail adress ("myemail"));   

Try changing it to the following?

  mail message. To add (new system.netmail.mail adress myemail);   

referenced

  string myemail = EmailAddress.Text;   

In addition, use the debugger

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -