while (lines = bufferlist.readLine()){
if (lines.equals(myTxt)) {
flagNameStr = 1;
break;
}
}
import sys
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
msg = MIMEMultipart()
msg['Subject'] = 'Тема письма'
msg['From'] = 'sender@mail.ru'
part = MIMEText('Текст письма\n')
msg.attach(part)
part = MIMEApplication(open('image.jpg', 'rb').read())
part.add_header('Content-Disposition', 'attachment', filename='image.jpg')
msg.attach(part)
server = smtplib.SMTP('smtp.mail.ru:587')
server.ehlo()
server.starttls()
server.login('sender@mail.ru', 'password')
server.sendmail(msg['From'], ['recipient@mail.ru'], msg.as_string())
<form>
<input type="text" name="otprav">
<button>Отправить</button>
</form
document.querySelector("form").addEventListener("submit", function(e) {
e.preventDefault();
const data = new FormData(this);
alert("Учи основы форм! \n MSG: " + data.get("otprav"));
});