Skip to content

Commit e6fe8af

Browse files
authored
Merge pull request #1085 from chrisisbeef/patch-2
Fixed replace bug
2 parents 884a24e + 56e11f1 commit e6fe8af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/phishing/smtp/client/smtp_web.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def mail(to, subject, prioflag1, prioflag2, text):
479479
# if we specify to track users, this will replace the INSERTUSERHERE with
480480
# the "TO" field.
481481
if track_email.lower() == "on":
482-
body_new = body_new.replace("INSERTUSERHERE", base64.b64encode(to.encode()))
482+
body_new = body_new.replace("INSERTUSERHERE", str(base64.b64encode(to.encode())))
483483
# call the function to send email
484484
try:
485485
mail(to, subject, prioflag1, prioflag2, body_new)
@@ -505,7 +505,7 @@ def mail(to, subject, prioflag1, prioflag2, text):
505505
# if we specify to track users, this will replace the INSERTUSERHERE
506506
# with the "TO" field.
507507
if track_email.lower() == "on":
508-
body_new = body_new.replace("INSERTUSERHERE", base64.b64encode(to.encode()))
508+
body_new = body_new.replace("INSERTUSERHERE", str(base64.b64encode(to.encode())))
509509
# send the actual email
510510
time_delay = check_config("TIME_DELAY_EMAIL=").lower()
511511
time.sleep(int(time_delay))

0 commit comments

Comments
 (0)