EzDevInfo.com

gmail interview questions

Top gmail frequently asked interview questions

Check unread count of Gmail messages with Python

How can I check the number of unread Gmail message in my inbox with a short Python script? Bonus points for retrieving the password from a file.


Source: (StackOverflow)

How to configure WAMP (localhost) to send email using Gmail?

I want to use the mail() function from my localhost. I have WAMP installed and a Gmail account. I know that the SMTP for Gmail is smtp.gmail.com and the port is 465 (more info from gmail). What I need to configure in WAMP so I can use the mail() function?

Thanks!!


Source: (StackOverflow)

Advertisements

What is "shva" in Gmail's URL?

What is the following portion of a Gmail URL for?

https://mail.google.com/mail/?**zx**=1efobg68r40co&**shva**=1#inbox

If you change it, nothing happens!!

I know Gmail is not an Open-Source program so we can't trace the code. But every website try to make the URL shorter so they ideally shouldn't add redundant data to the URL. At the same time they don't make any difference nor error if they change.

Edit: I know it's a parameter for a scripting language since I'm a PHP developer but as a developer I don't EVER add a useless parameter and I think it's obvious/primitive sense!


Source: (StackOverflow)

How can I shift-select multiple checkboxes like GMail?

In GMail, the user can click on one checkbox in the email list, hold down the Shift key, and select a second checkbox. The JavaScript will then select/unselect the checkboxes that are between the two checboxes.

I am curious as to how this is done? Is this JQuery or some basic (or complex) JavaScript?


Source: (StackOverflow)

How do i implement ‘sign in with google’ on my site?

On my site I would like to allow users to sign in with a google account. I plan to use openid but I would like to allow signing in with google because it has more benefits. I've noticed in the past a few sites that have the ability to sign in with a google (gmail) account and IIRC though they did NOT support openID (but I could be wrong).

How do I implement 'sign in with google' ?


Source: (StackOverflow)

Sending email in .NET through Gmail

Instead of relying on my host to send email, I was thinking of sending the messages though my Gmail account. The emails are personalized emails to the bands I play on my show. Is it possible to do?


Source: (StackOverflow)

Send email using the GMail SMTP server from a PHP page

I am trying to send an email via GMail's SMTP server from a PHP page, but I get this error:

authentication failure [SMTP: SMTP server does no support authentication (code: 250, response: mx.google.com at your service, [98.117.99.235] SIZE 35651584 8BITMIME STARTTLS ENHANCEDSTATUSCODES PIPELINING)]

Can anyone help? Here is my code:

<?php
require_once "Mail.php";

$from = "Sandra Sender <sender@example.com>";
$to = "Ramona Recipient <ramona@microsoft.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

$host = "smtp.gmail.com";
$port = "587";
$username = "testtest@gmail.com";
$password = "testtest";

$headers = array ('From' => $from,
  'To' => $to,
  'Subject' => $subject);
$smtp = Mail::factory('smtp',
  array ('host' => $host,
    'port' => $port,
    'auth' => true,
    'username' => $username,
    'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
  echo("<p>" . $mail->getMessage() . "</p>");
 } else {
  echo("<p>Message successfully sent!</p>");
 }
?>

Source: (StackOverflow)

How can I send an email by Java application using GMail, Yahoo, or Hotmail?

Is it possible to send an email from my Java application using a GMail account? I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Hotmail, Yahoo or GMail are acceptable.


Source: (StackOverflow)

Sending email through Gmail SMTP server with C#

For some reason the accepted answer or any others don't work for me for "Sending email in .NET through Gmail". Why would it not work?

UPDATE: I have tried all the answers (accepted and otherwise) in the other question, but neither work.

I would just like to know if it works for anyone else, otherwise Google have changed something (which has happened before).

When I try the piece of code that uses SmtpDeliveryMethod.Network, I quickly receive a SmtpException on Send(message). The message is

The SMTP server requires a secure connection or the client was not authenticated.

The server response was:

5.5.1 Authentication Required. Learn more at" <-- seriously, it ends there.

UPDATE:

This is a question I asked a long time ago, and the accepted answer has been code I've used many, many times on different projects.

I've taken some of the ideas in this post and other EmailSender projects to create an EmailSender project at Codeplex. It's designed for testability and supports my favourite SMTP services such as GoDaddy and Gmail.


Source: (StackOverflow)

How to send an email with Gmail as provider using Python?

I am trying to send email (Gmail) using python, but I am getting following error.

Traceback (most recent call last):  
File "emailSend.py", line 14, in <module>  
server.login(username,password)  
File "/usr/lib/python2.5/smtplib.py", line 554, in login  
raise SMTPException("SMTP AUTH extension not supported by server.")  
smtplib.SMTPException: SMTP AUTH extension not supported by server.

The Python script is the following.

import smtplib
fromaddr = 'user_me@gmail.com'
toaddrs  = 'user_you@gmail.com'
msg = 'Why,Oh why!'
username = 'user_me@gmail.com'
password = 'pwd'
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

Source: (StackOverflow)

Google's Imageless Buttons

There have been a few articles recently about Google's new imageless buttons:

I really like how these new buttons work in Gmail. How can I use these or similar buttons on my site? Are there any open source projects with a similar look & feel?

If I wanted to roll my own button package like this using JQuery/XHTML/CSS, what elements could I use? My initial thoughts are:

  1. Standard <input type="button"> with css to improve the look (the design article talked mostly about the css/imges involves.)

  2. Jquery javascript to bring up a custom dialog rooted to the button on the "onclick" event which would have <a> tags in them and a search bar for filtering? Would a table layout for that popup be sane?

I'm terrible at reverse engineering things on the web, what are some of the tools that I could use to help reverse engineer these buttons? Using Firefox's web developer toolbar I can't really see the css or javascript (even if it is minified) that is used on the buttons popup dialogs. What browser tool or other method could I use to peek at them and get some ideas?

I'm not looking to steal any of Google's IP, just get an idea of how I could create similar button functionality.


Source: (StackOverflow)

How can I download all emails with attachments from Gmail?

How do I connect to Gmail and determine which messages have attachments? I then want to download each attachment, printing out the Subject: and From: for each message as I process it.


Source: (StackOverflow)

Gmail extensions mail count is not working

The Gmail inbox feed is recently having issues updating. It is only updating after 2 consecutive and different emails have been marked as unread.

This is the official Gmail inbox atom feed API which is having issues as of May 30th and which many extensions are using: https://developers.google.com/gmail/gmail_inbox_feed

It is affecting all Gmail checking extensions:

Note, the same issue can also be reproduced by marking emails as read instead of unread.

Steps to reproduce the problem:

  1. Go to Gmail and mark an email as unread
  2. Click refresh in the "Checker Plus for Gmail" popup window or wait 1 minute in the Google Mail Checker
  3. Go to Gmail and mark another email as unread
  4. Click refresh in the "Checker Plus for Gmail" popup window or wait 1 minute in the Google Mail Checker

The unread mail count is not correctly displaying the number of unread emails with each mark as unread after refreshing. It only working after 2 consecutive mark as unread on different emails.

Are there workarounds or alternatives that do the same thing, or do I need to wait for Google to fix it?


Source: (StackOverflow)

Getting mail from GMail into Java application using IMAP

I want to access messages in GMail from a Java application using JavaMail and IMAP. Why am I getting a SocketTimeoutException?

Here is my code:

Properties props = System.getProperties();
props.setProperty("mail.imap.host", "imap.gmail.com");
props.setProperty("mail.imap.port", "993");
props.setProperty("mail.imap.connectiontimeout", "5000");
props.setProperty("mail.imap.timeout", "5000");

try {
  Session session = Session.getDefaultInstance(props, new MyAuthenticator());
  URLName urlName = new URLName("imap://MYUSERNAME@gmail.com:MYPASSWORD@imap.gmail.com");
  Store store = session.getStore(urlName);
  if (!store.isConnected()) {
    store.connect();
  }
} catch (NoSuchProviderException e) {
  e.printStackTrace();
  System.exit(1);
} catch (MessagingException e) {
  e.printStackTrace();
  System.exit(2);
}

I set the timeout values so that it wouldn't take "forever" to timeout. Also, MyAuthenticator also has the username and password, which seems redundant with the URL. Is there another way to specify the protocol? (I didn't see it in the JavaDoc for IMAP.)


Source: (StackOverflow)

Animated icon in email subject

I know about Data URIs in which base64 encoded data can be used inline such as images. Today I received an email actually a spam one in which there was an animated (gif) icon in its subject:

enter image description here

Here is the icon alone:

enter image description here

So the only thing did cross my mind was all about Data URIs and if Gmail allows some sort of emoticons to be inserted in subject. I saw the full detailed version of email and pointed to subject line at the below picture:

enter image description here

So GIF comes from =?UTF-8?B?876Urg==?= encoded string that's similar to Data URI scheme however I couldn't get the picture out of it. Here is element HTML source:

enter image description here

Long story short, there are a lot of emoticons from https://mail.google.com/mail/e/XXX where XXX are hexadecimal values. They are documented nowhere or I couldn't find it. If that's about Data URI, so how is it possible to include them in Gmail's email subject? (I forwarded that email to a yahoo email account, seeing [?] instead of icon) and if it's not, then how that encoded string is parsed?


Source: (StackOverflow)