diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb
index 29c204b..6242eb3 100644
--- a/login/ForgotPW.aspx.vb
+++ b/login/ForgotPW.aspx.vb
@@ -72,10 +72,10 @@ Partial Class login_ForgotPW
End Using
con.Close()
End Using
-
- If Not String.IsNullOrEmpty(username) Then
+ tokenname = genToken(username, password, email)
+ If SendEmail(username, password, email) = True Then
'password = RandomString(New Random, 10)
- tokenname = genToken(username, password, email)
+
'If (getDateoftoken(tokenname) = True) Then
'Dim msgboxstyle = vbDefaultButton1 + vbOK
@@ -88,7 +88,7 @@ Partial Class login_ForgotPW
MsgBox("Mail would be sent successfully!")
lblMessage.ForeColor = Color.Green
lblMessage.Text = "Passwort wurde erfolgreich an die angegebene E-Mail Adresse gesendet."
- Else
+ ElseIf SendEmail(username, password, email) = False Then
MsgBox("Mail would not be sent successfully!")
lblMessage.ForeColor = Color.Red
lblMessage.Text = "Diese E-Mail ist nicht in unserer Datenbank vorhanden."
@@ -121,15 +121,19 @@ Partial Class login_ForgotPW
mySmtpsvr.Credentials = myCredentials
Try
- 'genToken(username, password, email)
- Msg.From = New MailAddress("al@verag.ag")
- Msg.To.Add(email)
- Msg.Subject = "Passwort reset"
- Msg.Body = String.Format("Sehr geehrte/r {0},
Der Link zum Zurücksetzen des Passwortes lautet:
.
" + Environment.NewLine + lkb.PostBackUrl + Environment.NewLine + "
Mit freundlichen Grüßen,", username, password)
- ' Dim attachment As Attachment = New Attachment(File.OpenRead(excel), "Kundenliste.xlsx")
- ' Msg.Attachments.Add(attachment)
- mySmtpsvr.Send(Msg)
- MsgBox("SENT")
+ Dim tokennametemp = genToken(username, password, email)
+ If getDateoftoken(tokennametemp) = True Then
+ Msg.From = New MailAddress("al@verag.ag")
+ Msg.To.Add(email)
+ Msg.Subject = "Passwort reset"
+ Msg.Body = String.Format("Sehr geehrte/r {0},
Der Link zum Zurücksetzen des Passwortes lautet:
.
" + Environment.NewLine + lkb.PostBackUrl + Environment.NewLine + "
Mit freundlichen Grüßen,", username, password)
+ ' Dim attachment As Attachment = New Attachment(File.OpenRead(excel), "Kundenliste.xlsx")
+ ' Msg.Attachments.Add(attachment)
+ mySmtpsvr.Send(Msg)
+ MsgBox("SENT")
+ Else
+ Return False
+ End If
Return True
Catch ex As Exception
MsgBox(Err.Number & ex.Message & ex.StackTrace.ToString) 'Falls ein Fehler auftritt wird eine MsgBox angezeigt
@@ -152,7 +156,11 @@ Partial Class login_ForgotPW
MsgBox(Msg, Style, Title)
If MsgBox(Msg, Style, Title).Retry Then
- SendEmail(username, password, email)
+ If SendEmail(username, password, email) = True Then
+ MsgBox("SENT")
+ Else
+ MsgBox("Error02: Mail not delivered!")
+ End If
End If
End Try
End Function