Imports System
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Text
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Actions
Imports DevExpress.Persistent.Base
Public Class WebParameters_VC
Inherits DevExpress.ExpressApp.ViewController
Public Sub New()
MyBase.New()
InitializeComponent()
RegisterActions(components)
End Sub
Private Sub aSMTPTest_Execute(sender As System.Object, e As DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs) Handles aSMTPTest.Execute
Try
Dim _ocur As Xpo.XPObjectSpace = View.ObjectSpace
Dim _WebParameters As WebParameters = TryCast(View.SelectedObjects(0), WebParameters)
If _WebParameters Is Nothing Then Throw New Exception("*Váratlan hiba történt, a folyamat megszakadt!")
If String.IsNullOrEmpty(_WebParameters.SMTPHost) Then Throw New Exception("*Nincs megadva SMTP szerver!")
If _WebParameters.SMTPPort < 1 Then Throw New Exception("*Érvénytelen SMTP Port!")
If String.IsNullOrEmpty(_WebParameters.SMTPUserName) Then Throw New Exception("*Nincs megadva SMTP Felhasználói név!")
If String.IsNullOrEmpty(_WebParameters.SMTPPassword) Then Throw New Exception("*Nincs megadva SMTP jelszó!")
If String.IsNullOrEmpty(_WebParameters.Email_SupportAdmin) Then Throw New Exception("*Nincs megadva Support Admin e-mail cím!")
If _WebParameters.HTMLMailTemplate_QuestionUpdate Is Nothing Then Throw New Exception("*Nincs beállítva Kérdés e-mail sablon!")
If _WebParameters.HTMLMailTemplate_QuestionUpdate Is Nothing Then Throw New Exception("*Nincs beállítva Státusz e-mail sablon!")
If _WebParameters.HTMLMailTemplate_AnswerUpdate Is Nothing Then Throw New Exception("*Nincs beállítva Válasz e-mail sablon!")
Dim _MailMessage As New System.Net.Mail.MailMessage
Dim _SmtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient(_WebParameters.SMTPHost)
_MailMessage.From = New System.Net.Mail.MailAddress(_WebParameters.Email_SupportAdmin)
_MailMessage.To.Add(_WebParameters.Email_SupportAdmin)
_MailMessage.Subject = "Nuvolar SMTP beállítások - T E S Z T E M A I L"
_MailMessage.IsBodyHtml = True
Dim _EmailBody As String = ""
_EmailBody += String.Format("SMTP szerver: {0}
SMTP Port: {1}
SMTP Felhasználó: {2}
SMTP jelszó: {3}
", _
_WebParameters.SMTPHost, _WebParameters.SMTPPort, _WebParameters.SMTPUserName, _WebParameters.SMTPPassword)
_EmailBody += "