state = state / 21727;
state = state / 18199 - 11258;
state *= 18199;
state -= 11258;
state *= 21727;
import os
import smtplib
import ssl
from collections import namedtuple
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
msg = MIMEMultipart()
msg["Subject"] = "Subject"
msg["From"] = "test@corporate.ru"
#msg["To"] = "test@corporate.ru"
#msg["To"] = "test@yandex.ru"
msg["To"] = "test@gmail.com"
msg.attach(MIMEText("test text"))
EMAIL_HOST_USER = 'user'
EMAIL_HOST_PASSWORD = 'password'
path = "D:/Лара-Крофт.jpg"
attachment = MIMEApplication(open(path, "rb").read(), _subtype="jpg",
name=os.path.basename(path))
fn = {
"filename": os.path.basename(path),
# "filename*": ("utf-8''"+os.path.basename(path))
}
#attachment.add_header('Content-Disposition', 'attachment', **fn)
msg.attach(attachment)
#s = smtplib.SMTP_SSL('mail.corporate.ru', 465)
s = smtplib.SMTP('mail.corporate.ru', 25)
s.ehlo(EMAIL_HOST_USER)
s.starttls()
s.login(EMAIL_HOST_USER, EMAIL_HOST_PASSWORD)
s.sendmail(msg["From"], [msg["To"]], msg.as_string())
s.quit()
#print(msg.as_string())
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename*=utf-8''%D0%9B%D0%B0%D1%80%D0%B0-%D0%9A%D1%80%D0%BE%D1%84%D1%82.jpg
Content-Type: application/jpeg; name*=utf-8''%D0%9B%D0%B0%D1%80%D0%B0-%D0%9A%D1%80%D0%BE%D1%84%D1%82.jpg
$shares = get-WmiObject -class Win32_Share |Where-Object {$_.Description -ne "Default Share" -and $_.Description -ne "Remote IPC"}