Imports System.Collections.Generic
Imports System.Collections
Imports System.Reflection
Imports System.Runtime.CompilerServices
Imports System.Runtime.Serialization
Imports System.Xml.Serialization
Imports System.Xml.Schema
Public Class SMTPSettings
Public Property Host As String
Public Property Port As Integer
Public Property UserName As String
Public Property Password As String
Public Property UseSSL As String
Public Property TestEmailAddress As String
Dim xmlString as String = GetXml()
Dim xml = XElement.Parse(xmlString)
Dim smtp = New SMTPSettings With { _
.Host = xml.Element("Host"),
.Port = xml.Element("Port"),
.UserName = xml.Element("UserName"),
.Password = xml.Element("Password"),
.UseSSL = xml.Element("UseSSL"),
.TestEmailAddress = xml.Element("TestEmailAddress")
Function GetXml() As String
Dim xml as String = <SMTPSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Host>mail.clubcompete.com</Host>
<UserName>outgoing@clubcompete.com</UserName>
<Password>xxxxxxxxx</Password>
<TestEmailAddress>al@xxxxx-micro.com</TestEmailAddress>
</SMTPSettings>.ToString()