Jun-10-2024, 07:17 AM
I want to send emails to customers automatically. So I am testing with just 5 email addresses to see how it works
I import these
Must be a wrong email, because even when I tried to send from my email it bounced back!
But i noticed this: the time of the email which I sent from this laptop is the start of the computer epoch time (well, not quite):
My laptop shows the current time OK!
How can I get smtplib to put the current timestamp?
This sends the emails from my laptop via my QQ email OK, except for the timestamp:
I import these
import smtplib, ssl import json # for a list of email addresses from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipartOne test email did not get sent, the problem was:
Quote:No Mx Record Found
Must be a wrong email, because even when I tried to send from my email it bounced back!
But i noticed this: the time of the email which I sent from this laptop is the start of the computer epoch time (well, not quite):
Quote:时 间:1970-01-01 07:59:59
Time: 1970-01-01 07:59:59
My laptop shows the current time OK!
How can I get smtplib to put the current timestamp?
This sends the emails from my laptop via my QQ email OK, except for the timestamp:
with smtplib.SMTP_SSL(smtp_server, port, context=context) as server: server.login(sender_email, password) for e in email_address(customer_emails): print(f'email is {e} ') server.sendmail(sender_email, e, message) print(f'email sent to {r}')I don't know why the timestamp is 1970!