Verify emails using Google Apps Script - javascript

I have a list of email addresses in Google spreadsheet, I need to send them the same mail. so I wrote a script using Google Script that goes over the emails and send it.
My problem is that I am not sure that all the email addresses are valid. for example, name#gmaial.com instead of name#gmail.com. In this case, the mail won't be delivered.
I used Hunter API to achieve this, but I have a limited number of calls to theses API.
Can anyone help?

Related

How do I connect to the GMAIL API without the oAuth authentication? using js or PHP

I am trying to use GMAIL API to access my emails in my inbox because I want to list my emails on my website. But every time someone visits the page,they asked to login/thru google auth. I want the user to see it without google's OAuth authentication so they they will see it immediately. I have also tried PHP IMAP on gmail, but it loads a bit longer to load the email.
Thanks!

Google Apps Script - check if an email has sent properly

I'm working on a Google Apps Script project that sends an email when a button is clicked on a HTML sidepanel I've built. Currently the script works as planned and fires off an email when told, but I'm wondering if there's any way that it could check that the email sent correctly so I can notify the user that it's ok to close the tab?
Thanks in advance
If you are using the Gmail API to sending email, it will return the ID of the email that you can use to trace the email in your mailbox.
Google Script stores a copy of every sent email in the Gmail sent items folder. If you are using the GmailApp service, search the sent items for a copy of the email. If found, it was sent.
GmailApp.search("in:sent to:email#domain.com after:epoch_time")
You can use epoch time in Gmail search to find emails that were sent in the last minute or so.

posting to google sheets

I am trying to create a web form that will post data to my google sheet. I am finding that the only way to do this is to use OAuth2 where the client needs to authenticate with google. Is there a way that I can post to my own sheet without having to do the OAuth? I want to avoid having the google screen popup when trying to submit the form. Anyone know how to do this, without a hack? If it has to be done server-side, I am using PHP. Thanks
If it's your Google sheet that you are using for all visitors, then you only need to follow the flow once to obtain a refresh token and use a service account. This obviously has to be done server-side, otherwise you expose your credentials to every visitor.
This guide Using OAuth 2.0 for Server to Server Applications explains the process.

Open outlook email search from Java/JavaScript

Recently, I saw a form on SharePoint where user can select/search emails from a widget. It seemed to me that the emails were not locally stored and that SharePoint is somehow getting the emails from Outlook or an email server.
My question here would be that whether something like this is possible in Java/Javascript or not? So that I do not store emails locally and the search widget may bring the emails from an email server.
Thanks a lot.

How to send an email using JS or JQUERY but no MAILTO

Indeed it is an awesome day to everyone but not for me because I've been handling this battle cry for more than 13 days now and cant get it done. I have searched across the web but cant find the solution that can get my butt out of this mess. And yes stackoverflow is always my last resort when things get worse.
Can anyone suggest what is the best way(or even alternative) in sending email using js or jquery ?. Perhaps a simple snippet would do. Thanks!
You cannot send an email within the client browser. If your website is running on your own webserver, you can send a request from within the browser to your server that sends an email. If you're running a node.js server, there are many email apis.
For example, my business is a Mailjet customer, and so I can use the node-mailjet api on my server-side. Also there's https://nodemailer.com/ and similar npm packages.
Sending email only using javascript on client-side is not possible. By that you would give full control to user what and where he sends email - cool spam solution..
I wouldn't recommend to expose service from server that send email to client-side from server-side with full settings of message that will be sent. You don't want to allow spamming.
Only good approach is to predefine email on server and then when triggering action occurs resolve dynamic values in email on server and send email from server. Still you have to ensure user cant spam with some security policy.
So how to get out of this ? Implement service on server that will send emails for you (called with AJAX), lets say by code name and parameters. On server-side, choose template by code-name and resolve it by parameters passed with server request. Implement you security policy so you can be sure user cant spam (for example when user can choose to which email address will be message sent). Then pass it all to SMTP.

Categories