Fixed character error on Windows

This commit is contained in:
clamsawd 2015-10-27 16:37:22 +01:00
parent 7626670ee8
commit 0dae270af9

View File

@ -183,7 +183,10 @@ while PublicIP <= 2:
os.system("echo [ip2e-daemon] New IP - From "+CurrentIP+" to "+NewIP+" >> ip2e.log")
MailMessage="[ip2e-daemon] Email was sent successfully"
try:
os.system("sendEmail -q -f "+FromEmail+" -t "+ToEmail+" -u '[ip2e-daemon] IP has changed' -m 'ip2e - New IP is '"+NewIP+" -s "+SmtpFromEmail+" -xu "+FromEmailUser+" -xp "+FromEmailPass)
if os.name == "posix":
os.system("sendEmail -q -f "+FromEmail+" -t "+ToEmail+" -u '[ip2e-daemon] IP has changed' -m '[ip2e] New IP is '"+NewIP+" -s "+SmtpFromEmail+" -xu "+FromEmailUser+" -xp "+FromEmailPass)
elif os.name == "nt":
os.system("sendEmail -q -f "+FromEmail+" -t "+ToEmail+" -u [ip2e-daemon] IP has changed -m [ip2e] New IP is "+NewIP+" -s "+SmtpFromEmail+" -xu "+FromEmailUser+" -xp "+FromEmailPass)
except:
MailMessage="[ip2e-daemon] Fail to send email"
print (MailMessage+" ("+ToEmail+")")