Основы работы с XHTML и CSS


Example.11.37


Sub Submit_Form (Src As Object, Args As EventArgs)

If Email.Text <> "" Then

Dim MyEmail = New MailMessage

MyEmail.From = "dadams@mail.maconstate.edu"

MyEmail.To = Email.Text

MyEmail.Subject = "Form Submission"

MyEmail.Body = "

Membership Form

"

MyEmail.Body &= "First Name = " & FirstName.Text & "
"

MyEmail.Body &= "Last Name = " & LastName.Text & "
"

If Gender1.Checked Then

MyEmail.Body &= "Gender = " & Gender1.Text & "
"

ElseIf Gender2.Checked Then

MyEmail.Body &= "Gender = " & Gender2.Text & "
"

Else

MyEmail.Body &= "Gender = Not checked

"

End If

MyEmail.Body &= "Major = " & Major.SelectedItem.Text & "
"

MyEmail.Body &= "Reason = " & Reason.Text & "
"

MyEmail.BodyFormat = MailFormat.Html

SmtpMail.Send(MyEmail)

Message.Text = "Form posted. Check your email."

Else

Message.Text = "Missing email address. Not posted."

End If

End Sub




Начало  Назад  Вперед



Книжный магазин