Files
VERAG_Homepage/sendFeedback.aspx
2021-07-06 10:03:36 +02:00

154 lines
5.7 KiB
Plaintext

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="shortcut_icon" type="image/x-icon" href="images/Icons/favicon/favicon.ico">
<link rel="stylesheet" type="text/css" href="css/edit_main.css">
<% @Import Namespace="System.net.Mail" %>
<script runat="server">
Protected Sub Button1_Click(sender As Object, e As EventArgs)
SendEmail()
If False Then
Const SMTPSendUsing = 2 ' SMTP über Netzwerk
Const SMTPServer = "smtp.1und1.de"
Const SMTPServerPort = 25 '587'25
Const SMTPConnectionTimeout = 10 'Sekunden
Dim sSubject, sEmail, sMailBody, sFrom, sReadReceipt, sMsg
sSubject = "Test"
sEmail = "al@verag.ag"
sMailBody = "Dies ist eine Testnachricht."
sFrom = "al@verag.ag"
sReadReceipt = True
sMsg = ""
On Error Resume Next
Dim oMail, oConfig, oConfigFields
oMail = Server.CreateObject("CDO.Message")
oConfig = Server.CreateObject("CDO.Configuration")
oConfigFields = oConfig.Fields
With oConfigFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = SMTPSendUsing
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPServerPort
.Update()
End With
oMail.Configuration = oConfig
oMail.Subject = sSubject
oMail.From = sFrom
oMail.To = sEmail
oMail.HTMLBody = sMailBody
oMail.EnableSsl = True
'oMail.port = 587
oMail.Send()
oMail = Nothing
sMsg = "Nachricht gesendet."
If Err.Number <> 0 Then sMsg = "Fehler: " & Err.Description
Response.Write(sMsg)
' Dim msgMail As New MailMessage("al@verag.ag", "al@verag.ag")
' msgMail.To = "christophw@sleeper.Dev.AlfaSierraPapa.Com"
' msgMail.Cc = "webmaster@sleeper.Dev.AlfaSierraPapa.Com"
' msgMail.From = "webmaster@aspheute.com"
' msgMail.Subject = "Hi Chris, another mail"
'' Dim strBody As String = "<html><body><b>Hello World</b>" &
' " <font color='red'>ASP.NET</font></body></html>"
' msgMail.Body = strBody
' Dim smtp As New SmtpClient()
' smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis
' smtp.Send(msgMail)
Response.Write("Email was queued to disk")
End If
End Sub
Function SendEmail() As Boolean
Dim Msg As New MailMessage
Dim myCredentials As New System.Net.NetworkCredential
myCredentials.UserName = "al@verag.ag"
myCredentials.Password = "Luxandreas#2"
Msg.IsBodyHtml = False
Dim mySmtpsvr As New SmtpClient()
mySmtpsvr.Host = "smtp.1und1.de" 'bei web.de
mySmtpsvr.Port = 587 '25
mySmtpsvr.UseDefaultCredentials = False
mySmtpsvr.Credentials = myCredentials
Try
Msg.From = New MailAddress("al@verag.ag")
Msg.To.Add("al@verag.ag")
Msg.Subject = "TEST"
Msg.Body = "TEST"
' Dim attachment As Attachment = New Attachment(File.OpenRead(excel), "Kundenliste.xlsx")
' Msg.Attachments.Add(attachment)
' mySmtpsvr.Send(Msg)
MsgBox("SENT")
Return True
Catch ex As Exception
MsgBox(Err.Number & ex.Message & ex.StackTrace.ToString) 'Falls ein Fehler auftritt wird eine MsgBox angezeigt
End Try
Return False
End Function
</script>
</head>
<body style="width:500px;padding:0px;margin:0px;overflow-x: hidden;background-image:none" >
<div style="width:100%;height:25px;background-color: #003680;font-size:16px;color:white;padding:10px;" ><b>Feedback</b></div>
<form id="form1" runat="server">
Sie können uns hier eine Nachricht schreiben, ein Mitarbeiter wird sich umgehend darum kümmern:
<br/> <br/>
<table style="width:100%; height: 361px;">
<tr>
<td>Name / Firma:<br/><input type="text" name="name" value="" style="width:100%"></td>
</tr>
<tr>
<td>E-Mail:<br/><input type="text" name="emailFrom" value="" style="width:100%"></td>
</tr>
<tr>
<td>Nachricht:<br/><textarea name="message" style="width:100%" rows="10"></textarea></td>
</tr>
<tr>
<td><input type="submit" name="sendthis" value="Nachricht senden" ><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</td>
</tr>
</table>
</form>
</body>