Aug-08-2017, 09:01 AM
In one MacOSX I found an issue with date and time while receiving mails from all my python scripts(in this case 2), where some are being received without any date, and others with a US format(month/day/year), not sure, and I want to use the day/month/year format, and others with wrong time. Seems to be almost random when it occurs.
For example in a webmail that I have installed in that server as well as thunderbird I notice this problem, and I have also different reception date and/or time in the same mail. In Gmail app from android, I dont have this issue at all, all dates and time are correct.
I know that there is the formatdate(localtime=True) but dont know how to setup to my current config.
For example in a webmail that I have installed in that server as well as thunderbird I notice this problem, and I have also different reception date and/or time in the same mail. In Gmail app from android, I dont have this issue at all, all dates and time are correct.
#server = smtplib.SMTP(mail_server,25) server = smtplib.SMTP(mail_server,587) server.starttls() server.login(smtp_auth_name,smtp_auth_pass) subject = '%s_BACKUP job success made on %s' %(backup_identifier,server_name) message = 'Current Config:\n%s\nStart time: %s\nFinish time: %s\nTarget path: %s\n\nStatus: \n\n%s\n\nBackup has been done.' %(current_config,inicial_date.strftime("%d/%m/%y %H:%M:%S"),datetime.datetime.now().strftime("%d/%m/%y %H:%M:%S"),backup_folder,checkpoint) message_structure = 'From: %s\nTo: %s\nSubject: %s\nDate: %s\n\n%s' %(sender,email_receivers,subject,datetime.datetime.now().strftime("%d/%m/%y %H:%M:%Ss"),message) server.sendmail(sender,email_receivers,message_structure) server.quit() logging.debug('Email notification as been send to: %s',email_receivers)So seems that there is a problem with the atribution of date and time in mail clients, and my question is how can I use just the date and time from my mail server instead.
I know that there is the formatdate(localtime=True) but dont know how to setup to my current config.
