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

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -