I have one particular usecase, where I would like to send from aliased account in Gmail. AFAIK yagmail supports only aliases in email {email_acc : 'User' } in SMTP login function, which changes only display name but not email.
Example:
I login in Gmail with mike.d@gmail.com, but I would like to send email with mike@gmail.com.
Where should I look to implement this functionality? I was looking at yagmail/sender.py, function attempt send - is this the correct place?
def _attempt_send(self, recipients, msg_string): attempts = 0 while attempts < 3: try: result = self.smtp.sendmail(self.user, recipients, msg_string) self.log.info('Message sent to %s', recipients) self.num_mail_sent += 1 return result except smtplib.SMTPServerDisconnected as e: self.log.error(e) attempts += 1 time.sleep(attempts * 3) self.unsent.append((recipients, msg_string)) return False
I have one particular usecase, where I would like to send from aliased account in Gmail. AFAIK yagmail supports only aliases in email {email_acc : 'User' } in SMTP login function, which changes only display name but not email.
Example: I login in Gmail with mike.d@gmail.com, but I would like to send email with mike@gmail.com.
Where should I look to implement this functionality? I was looking at yagmail/sender.py, function attempt send - is this the correct place?
def _attempt_send(self, recipients, msg_string): attempts = 0 while attempts < 3: try: result = self.smtp.sendmail(self.user, recipients, msg_string) self.log.info('Message sent to %s', recipients) self.num_mail_sent += 1 return result except smtplib.SMTPServerDisconnected as e: self.log.error(e) attempts += 1 time.sleep(attempts * 3) self.unsent.append((recipients, msg_string)) return False