Imports System.Net.Mail
Partial Class orderForm
Inherits System.Web.UI.Page
Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick
SendMail(txtJmeno.Text, txtPrijmeni.Text, txtUlice.Text, txtMesto.Text, txtPsc.Text, txtTelefon.Text, txtEmail.Text, txtZbozi.Text, txtBarva.Text, txtMnozstvi.Text, txtPoznamka.Text)
End Sub
Private Sub SendMail(ByVal jmeno As String, ByVal prijmeni As String, ByVal ulice As String, ByVal mesto As String, ByVal psc As String, ByVal telefon As String, ByVal email As String, ByVal zbozi As String, ByVal barva As String, ByVal mnozstvi As String, ByVal poznamka As String)
Dim mailServerName As String = "smtp.domena.cz"
Dim message As MailMessage = New MailMessage(email, "[email protected]", "objednávka", jmeno)
Dim mailClient As SmtpClient = New SmtpClient
mailClient.EnableSsl = True
mailClient.Host = mailServerName
mailClient.UseDefaultCredentials = False
mailClient.Credentials = New System.Net.NetworkCredential("[email protected]", "heslo")
message.Body = " Jmeno: " & txtJmeno.Text.ToString() + vbCrLf & " Prijmeni: " & txtPrijmeni.Text.ToString() + vbCrLf & " Ulice: " & txtUlice.Text.ToString() + vbCrLf & " Mesto: " & txtMesto.Text.ToString() + vbCrLf & " PSC: " & txtPsc.Text.ToString() + vbCrLf & " Telefon: " & txtTelefon.Text.ToString() + vbCrLf & " Email: " & txtEmail.Text.ToString() + vbCrLf & " TypZbozi: " & txtZbozi.Text.ToString() + vbCrLf & " Barva: " & txtBarva.Text.ToString() + vbCrLf & " Mnozstvi: " & txtMnozstvi.Text.ToString() + vbCrLf & " Poznamka: " & txtPoznamka.Text.ToString()
mailClient.Send(message)
message.Dispose()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
End Class
|