Error creating SMTPClient

Discussion in 'General troubleshooting' started by JonnyBravo, Mar 4, 2013.

  1. My app (VB ASP.NET) sends emails with attachments. I'm getting an error though when I try and create the variable.

    This line: Dim SMTPMessage As New SMTPClient

    produces this error:

    property 'port'. (E:\web\timeclox\web.config line 176) at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult) at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Web.HttpContext.GetSection(String sectionName) at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName) at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) at System.Net.Configuration.SmtpSectionInternal.GetSection() at System.Net.Mail.SmtpClient.get_MailConfiguration() at System.Net.Mail.SmtpClient.Initialize() at System.Net.Mail.SmtpClient..ctor() at Time_Entry_System.Login.Page_Load(Object sender, EventArgs e)

    I think it has something to do with trust but I'm unsure. Does anyone have an idea?
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  3. That did the trick! Thanks much!
     
  4. Elshadriel

    Elshadriel Winhost Staff

    Ok. Great! :)
     

Share This Page