This question has been flagged
1 Reply
2459 Views

Hi,

I had an error while sending email ,by clicking submit button I want to send my manager that I have submitted time sheet,I am using odoo 11

My code details :

mail_values = {
'email_from': self.employee_id.work_email,
'email_to': self.employee_id.parent_id.work_email,
'subject': 'Timesheet submitted ' + self.employee_id.name,
'body_html': 'Timesheets ' + self.date_start + ' to ' + self.date_end + ' had been submitted by '
+ self.employee_id.name + ' for your approval<br>Please <a href="http://http://localhost:8069/web#view_type=list&model=hr_timesheet.sheet&menu_id=615&action=797">click here</a> to approve or reject<br> Regards,<br>',
'notification': True,
}
mail = self.env['mail.mail'].create(mail_values)
mail.send()


and I got this error:
(535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials l81sm13934918pfg.100 - gsmtp')
Avatar
Discard
Best Answer

Hi,

Enable less secure apps in the Gmail account, hope it will sort out the issue that you are facing. See how to do it: https://support.google.com/accounts/answer/6010255


Please see this question in StackOverflow: https://stackoverflow.com/questions/16512592/login-credentials-not-working-with-gmail-smtp


Thanks

Avatar
Discard
Author

Thank you for the help.It works.