I have a gmail account.

Is there a Google API that allows me to log into this account and send emails?

3 Answers 3


Yes. And the easiest way to find the documentation of it is by googling "gmail api".

See here.

You can also use any generic SMTP client. See Sending mail from a printer, scanner or app

  • If I use the 2nd method, does the "from" still come from the gmail.com account? Or will it be my own domain name? I want the "from" to still be my gmail.
    – Alex
    Jun 11, 2013 at 11:02
  • It's whatever the application puts in the From: header.
    – Barmar
    Jun 11, 2013 at 11:05
  • @Alex - So indicate the address sending the email is your google account. You should be aware that Google has a limit on the number of emails you can send in a given day. If your using your account to advertise it will likely be locked down.
    – Ramhound
    Jun 11, 2013 at 11:21
  • your here link seems to be very broad, maybe it's meant to point to Gmail API Overview | Gmail API | Google Developers
    – Wolf
    Apr 18, 2017 at 8:43
  • Apparently they consider sending emails as "restricted" so to do it you need to pay $15000 and wait two months to get your project approved. I think it's much simpler to just use Gmail's SMTP as explained in this answer. Jan 15, 2020 at 13:06

In a sentence: Just send email programmatically like you would with any other mail provider - using the SMTP protocol (over SSL): Connect to smtp.gmail.com on port 465 or 587, and give the username and password. On a UN*X system, you could use something like sendmail (or another MTA) + mailx, the latter being a command-line utility. See, e.g., here about using it.


Yes, you can send email programmatically. You first need to generate appropriate application password, authenticate with the correct SMTP server and use SMTP client library to send email.

Follow this tutorial for more information (https://ps06756.wordpress.com/2017/08/17/how-to-send-email-through-gmail-programmatically/)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .