[autotest] Use gmail API to send out email

Also force host label metadata to be uploaded with http.

BUG=None
TEST=None

Change-Id: I34af2c834d44ab42eac89a60eada530a5f8a0ecb
Reviewed-on: https://chromium-review.googlesource.com/263305
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
diff --git a/site_utils/host_label_utils.py b/site_utils/host_label_utils.py
index d30d1b8..9ea433c 100755
--- a/site_utils/host_label_utils.py
+++ b/site_utils/host_label_utils.py
@@ -107,13 +107,13 @@
         info = {'hostname': host.hostname,
                 'labels': [label.name for label in host.labels.all()],
                 'time_index': time_index}
-        autotest_es.post(type_str=_HOST_LABEL_TYPE, metadata=info,
-                                   log_time_recorded=False)
+        autotest_es.post(use_http=True, type_str=_HOST_LABEL_TYPE,
+                         metadata=info, log_time_recorded=False)
 
     # After all host label information is logged, save the time stamp.
-    autotest_es.post(type_str=_HOST_LABEL_TIME_INDEX_TYPE,
-                               metadata={'time_index': time_index},
-                               log_time_recorded=False)
+    autotest_es.post(use_http=True, type_str=_HOST_LABEL_TIME_INDEX_TYPE,
+                     metadata={'time_index': time_index},
+                     log_time_recorded=False)
     logging.info('Finished collecting host labels for %d hosts.', len(hosts))