Click here to Skip to main content
15,926,507 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: asp.net Pin
smgetaweh18-Nov-06 15:37
smgetaweh18-Nov-06 15:37 
GeneralRe: asp.net Pin
Grapes-R-Fun27-Nov-06 4:58
Grapes-R-Fun27-Nov-06 4:58 
GeneralRe: asp.net Pin
smgetaweh27-Nov-06 23:37
smgetaweh27-Nov-06 23:37 
GeneralRe: asp.net Pin
Grapes-R-Fun28-Nov-06 2:38
Grapes-R-Fun28-Nov-06 2:38 
GeneralRe: asp.net Pin
smgetaweh28-Nov-06 2:51
smgetaweh28-Nov-06 2:51 
GeneralRe: asp.net Pin
Grapes-R-Fun28-Nov-06 2:40
Grapes-R-Fun28-Nov-06 2:40 
QuestionAsp.net2.0 with Ajax updatepanel Pin
netJP12L15-Nov-06 5:54
netJP12L15-Nov-06 5:54 
QuestionAsp.Net 2.0 Net.Mail. I don't know what else to try. Thanks. Pin
shapper15-Nov-06 4:41
shapper15-Nov-06 4:41 
Hello,

I am trying to send an email from a form in my web page.

I have the following codes:

...
Dim mailSettings As New System.Net.Configuration.MailSettingsSectionGroup
Dim smtpClient As New System.Net.Mail.SmtpClient
smtpClient.Host = mailSettings.Smtp.Network.Host
smtpClient.UseDefaultCredentials = False
smtpClient.Port = mailSettings.Smtp.Network.Port
smtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
smtpClient.Credentials = New System.Net.NetworkCredential(mailSettings.Smtp.Network.UserName, mailSettings.Smtp.Network.Password)

smtpClient.Send(message)
...

And in my Web.Config file I have:

<system.net>
<mailSettings>
<smtp deliveryMethod = "network">
<network defaultCredentials = "true"
host = "mail.domain.com"
password = "secret"
port = "25"
userName = "user@domain.com" />
</smtp>
</mailSettings>
</system.net>

I am getting the error:
"ConfigurationSectionGroup cannot be edited before being added to a section group belonging to an instance of class Configuration"

I looked for a solution all day and I can't solve this.

Could someone tell me what am I doing wrong here?

Thanks,
Miguel
AnswerRe: Asp.Net 2.0 Net.Mail. I don't know what else to try. Thanks. Pin
ednrgc15-Nov-06 4:47
ednrgc15-Nov-06 4:47 
AnswerRe: Asp.Net 2.0 Net.Mail. I don't know what else to try. Thanks. Pin
ednrgc15-Nov-06 4:50
ednrgc15-Nov-06 4:50 
GeneralRe: Asp.Net 2.0 Net.Mail. I don't know what else to try. Thanks. Pin
shapper15-Nov-06 5:43
shapper15-Nov-06 5:43 
GeneralRe: Asp.Net 2.0 Net.Mail. I don't know what else to try. Thanks. Pin
ednrgc15-Nov-06 5:45
ednrgc15-Nov-06 5:45 
GeneralRe: Asp.Net 2.0 Net.Mail. I don't know what else to try. Thanks. Pin
shapper15-Nov-06 6:00
shapper15-Nov-06 6:00 
QuestionEmail Program Pin
Abhishek Maitrey15-Nov-06 4:23
Abhishek Maitrey15-Nov-06 4:23 
AnswerRe: Email Program Pin
ednrgc15-Nov-06 4:48
ednrgc15-Nov-06 4:48 
AnswerRe: Email Program Pin
Frank Kerrigan15-Nov-06 5:54
Frank Kerrigan15-Nov-06 5:54 
Questionhow can i got an inistance of a page from the assembly ? Pin
Modern_night15-Nov-06 3:12
Modern_night15-Nov-06 3:12 
AnswerRe: how can i got an inistance of a page from the assembly ? Pin
l0kke15-Nov-06 3:29
l0kke15-Nov-06 3:29 
QuestionValidation Problem Pin
monika_vasvani15-Nov-06 3:00
monika_vasvani15-Nov-06 3:00 
AnswerRe: Validation Problem Pin
l0kke15-Nov-06 3:50
l0kke15-Nov-06 3:50 
QuestionHow to retain the value textboxes between different forms? Pin
minibansal15-Nov-06 2:29
minibansal15-Nov-06 2:29 
AnswerRe: How to retain the value textboxes between different forms? Pin
Tamimi - Code15-Nov-06 2:41
Tamimi - Code15-Nov-06 2:41 
AnswerRe: How to retain the value textboxes between different forms? Pin
Britney S. Morales15-Nov-06 5:01
Britney S. Morales15-Nov-06 5:01 
QuestionDatalist paging Error Pin
mohd faiz15-Nov-06 2:21
mohd faiz15-Nov-06 2:21 
AnswerRe: Datalist paging Error Pin
Paddy Boyd15-Nov-06 2:51
Paddy Boyd15-Nov-06 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.