Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoIannacone committed Nov 6, 2014
1 parent cd1a691 commit 7795d9e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions host/gmail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def _refresh_credentials(self):

def _smtp_login(self):
"""
Loging in GMail smtp
Login in GMail smtp
"""
self._refresh_credentials()

# intialize SMTP procedure
# initialize SMTP procedure
self.smtp = SMTP('smtp.gmail.com', 587)

if self.logger.getEffectiveLevel() == logging.DEBUG:
Expand Down Expand Up @@ -216,7 +216,7 @@ def _remove_bcc_from_header(message):
if not isinstance(message, (str, unicode)):
message = message.as_string()

# slipt the message in header and body
# split the message in header and body
header, body = message.split('\n\n', 1)

# check for Bcc in headers and remove it
Expand All @@ -238,10 +238,6 @@ def _remove_bcc_from_header(message):
return '\n\n'.join([header, body])

def send(self, id, message, delete_draft=True):
# APIs do not work
# raw = base64.urlsafe_b64encode(message.as_string())
# body = {'raw': raw}
# self.messages.send(userId='me', body=body).execute()

if isinstance(message, (str, unicode)):
msg_str = message
Expand All @@ -257,6 +253,10 @@ def send(self, id, message, delete_draft=True):
if 'Bcc' in message:
msg_str = self._remove_bcc_from_header(msg_str)

# APIs do not work
# raw = base64.urlsafe_b64encode(msg_str)
# self.messages.send(userId='me', body={'raw': raw}).execute()

try:
self.smtp.sendmail(self.username, receivers, msg_str)
except SMTPServerDisconnected:
Expand Down

0 comments on commit 7795d9e

Please sign in to comment.