Send An Email From Your Gmail Account with VBA | Excel VBA Tutorial

  Рет қаралды 38,172

Jie Jenn

Jie Jenn

Күн бұрын

Buy Me a Coffee? www.paypal.me/jiejenn/5
Your donation will support me to continue to make more tutorial videos!
Gmail, the world most popular email service developed by Google. Today just about almost everyone owns a Gmail account. We know it is pretty easy to create a VBA script in Microsoft Excel to integrate with Microsoft Outlook, from there, we can send an Outlook email, create an Outlook task and contacts, all within Excel. But do you know that, in VBA (Excel, Access, Outlook, Word, PowerPoint), we can also write a script to send an email from our Gmail account or any email service provider uses SMTP, IMAP, POP server settings.
In this tutorial, I will walk you through how to write a VBA script to send an email from your Gmail account.
Google Gmail SMTP Information
support.google.com/mail/answe...
VBA Script
learndataanalysis.org/send-em...

Пікірлер: 79
@jiejenn
@jiejenn 4 жыл бұрын
If you want to attach multiple attachment, you will need to insert another addAttachment statement. For example With newMail .Subject = "Hello World" .From = "sender Email" .To = "recipient Email" .CC = "" .BCC = "" .TextBody = "This is a test email." .AddAttachment "directory of file1" .AddAttachment "directory of file2" .AddAttachment "directory of file3" End With
@amardeepsinghrawat4986
@amardeepsinghrawat4986 4 жыл бұрын
thanks dude.!!! this was really amazing..
@jasonfleishman9884
@jasonfleishman9884 2 жыл бұрын
... hahaha ... I'm giddy with excitement. Thank you!
@manvimanglik8921
@manvimanglik8921 4 жыл бұрын
thanks it really helped a lot
@tandy1972
@tandy1972 5 жыл бұрын
Hi! Preety good! I have a question, how can I put that image in the body too?
@kotermack
@kotermack Жыл бұрын
Nice lesson, thanks for posting it! Can you show how to manipulate with different recepients?
@ankitshsharma
@ankitshsharma 5 жыл бұрын
Can I use for loop to send the mail to different people
@corporateactionazimut4132
@corporateactionazimut4132 3 жыл бұрын
Hi, very good! I have a question, how can I only prepare mail without send immediatly, and see themm in the gmail draft folder? Many thanks.
@KeffelewAssefa
@KeffelewAssefa 2 жыл бұрын
Thank you
@haribhaskar72
@haribhaskar72 4 жыл бұрын
Hi.. I have more than one files to send to the same email id - One attachment per email. Can i loop through the files in the folder to send as per my expectations
@sergioroselli5726
@sergioroselli5726 4 жыл бұрын
Hi, can send a more mail in one click, from a Excel mailing LIST ?
@flowdj00
@flowdj00 3 жыл бұрын
Would this code work on visual studio?
@arshadali6842
@arshadali6842 3 жыл бұрын
what is the msoconfigURL how did i get this for my email ID??
@tandy1972
@tandy1972 5 жыл бұрын
Hi! Pretty good! I have a question, do you know how to put that image in the body of the email too?
@jiejenn
@jiejenn 5 жыл бұрын
I haven't try inserting an image to the email body. Will probably experiment a bit first.
@matthieuboucher143
@matthieuboucher143 4 жыл бұрын
@@jiejenn Hi Jie, I am looking to attach both an image in the body (saved from a printing area in a worksheet) and a PDF as an attachment. I would love to pick your brain on this one :)
@pauwelsgnanih7136
@pauwelsgnanih7136 3 жыл бұрын
The transport failed to connect to the server, I am using gmail. Pleas help me. Using Excel 2016, 64 bits
@mittapalli1990
@mittapalli1990 4 жыл бұрын
The transport failed to connect to the server, I am using gmail. Pleas help me
@yashparekh22
@yashparekh22 2 жыл бұрын
Hello, Thank you for the tutorial. Also can you upload a vba tutorial on how to download attachment from Gmail in specific format and fill up the mail details in 1 excel macro file.
@jiejenn
@jiejenn 2 жыл бұрын
I will look into it.
@yashparekh22
@yashparekh22 2 жыл бұрын
Thank you... It would be very helpful if that is possible.
@irinkhan8114
@irinkhan8114 Жыл бұрын
When my email id is wrong (i.e, not found in mail address book),the macro stops running. What can be done to prevent thia as this prevents from sending my others mails to users in the same column??
@saumyabhattacharya2067
@saumyabhattacharya2067 4 жыл бұрын
how to read emails from Gmail box using VBA?
@hhexeh
@hhexeh 4 жыл бұрын
how to add a loop to use excel list with multiple recepients and their relevant attachments?
@jiejenn
@jiejenn 4 жыл бұрын
You can make the subroutine serves as a function. To add multiple attachments, I'm going to have do some research.
@opfmnegros-occfses5435
@opfmnegros-occfses5435 3 жыл бұрын
it says Error: The process cannot access the file because it is being used by another process. help please
@AmitHattiholi
@AmitHattiholi 2 жыл бұрын
Hi! I am getting this error when I try to run it. Automation error %1 is not a valid Win32 application.
@ingridglorieux6414
@ingridglorieux6414 3 ай бұрын
Thanks for the video. Is it true that this method will no longer be supported, but should be switched to OAuth 2.0? Do you know how to get started with this?
@jiejenn
@jiejenn 3 ай бұрын
Unfortunately I don't know the best way to use OAuth2 protocol in VBA, but if you have some experience with Python, OAuth2 is definitely the way to go to send email with Gmail.
@user-zw7dw4gq1s
@user-zw7dw4gq1s 8 күн бұрын
I got error: & err.description, vbinformation in my case, what can be wrong?
@AnthonyJohnFajardo
@AnthonyJohnFajardo 6 күн бұрын
I am getting the server response was not available error. Please Help
@dannyworshop1466
@dannyworshop1466 4 жыл бұрын
Hello there I always encounter this "The “SendUsing” configuration value is invalid" is there any workaround?
@jiejenn
@jiejenn 4 жыл бұрын
What value are you providing to the SendinfUsing property?
@dannyworshop1466
@dannyworshop1466 4 жыл бұрын
@@jiejenn all is good i found out there are lapses on the spelling, all is good. More power!!!
@kajalkhatri9238
@kajalkhatri9238 Жыл бұрын
When i run it it gives error of sendingusing configuration value as invalid
@anasqureshi113
@anasqureshi113 Жыл бұрын
Error- The system cannot find the path specified'. This error is showing while the code can someone help me on this ?
@fabioandresurbinasoares9046
@fabioandresurbinasoares9046 Жыл бұрын
With this code is it possible to send 500 more E-mails, or would it be blocked by the provider if you exceed this limit?
@jiejenn
@jiejenn Жыл бұрын
500 is a small number I won't worry about it, but I would suggest you separate them into batches between intervals.
@yrlandrevancedelosa3690
@yrlandrevancedelosa3690 2 жыл бұрын
Hi! Can you share how we can send it to a list of emails in excel?
@jiejenn
@jiejenn 2 жыл бұрын
You can create a list and iterate each email address.
@kleber_bispo
@kleber_bispo Жыл бұрын
Mr. Jenn, is it possible to run this script to send email from outlook account without an outlook app?
@jiejenn
@jiejenn Жыл бұрын
If you know any programming, you can use Microsoft Graph API to to manage your Outlook tasks. learn.microsoft.com/en-us/graph/api/resources/mail-api-overview?view=graph-rest-1.0
@monitsharma6618
@monitsharma6618 2 жыл бұрын
Error : :The system cannot nind the files spicified" Please solution
@naveenkumarraju4129
@naveenkumarraju4129 2 жыл бұрын
it's look's great Sir, I'm getting error when I run this code Error: The SMTP server name is required, and was not found in configuration source. I gave the same code what you gave, Can you help me on this pls
@jiejenn
@jiejenn 2 жыл бұрын
Please refer your question on Stack Overflow.
@LifewithFoods
@LifewithFoods 4 жыл бұрын
How is the highlighted font of ur code is red instead of blue...how did u do that
@jiejenn
@jiejenn 4 жыл бұрын
Under Tools, go to Editor Format tab, from there, you can format the text.
@LifewithFoods
@LifewithFoods 4 жыл бұрын
@@jiejenn thanks🙂
@pacoramirez7363
@pacoramirez7363 4 жыл бұрын
So now how do I make an Excel spreadsheet in my Gmail?
@jiejenn
@jiejenn 4 жыл бұрын
Not sure if I understand your question.
@williehanekom858
@williehanekom858 5 ай бұрын
When i want to sent message to email address on cell in sheet what will the code be , because .To = Range("D15") dont work and this is the range off the cell
@jiejenn
@jiejenn 5 ай бұрын
Not enough information to help. Maybe change to =Range("D15").value.
@FrancescoSantoro80
@FrancescoSantoro80 2 жыл бұрын
good morning is there a parameter to program the email for postponed sending?
@jiejenn
@jiejenn 2 жыл бұрын
You can look into Application.Wait function.
@FrancescoSantoro80
@FrancescoSantoro80 2 жыл бұрын
@@jiejenn good morning you could give me some more information that I'm not very practical thanks
@mohamadtayb7711
@mohamadtayb7711 2 жыл бұрын
i have error : Error The "Sendusing" configuration value is invalid i write it correct .Item(msconfigurl & "/sendusing") = 2
@jiejenn
@jiejenn 2 жыл бұрын
Probably a typo somewhere in your script.
@NothingMuchhere2see
@NothingMuchhere2see 2 жыл бұрын
i am getting error for " SendUsing Configuration value is invalid" please suggest what should i do next
@jiejenn
@jiejenn 2 жыл бұрын
Makes sure you provide the correct credential info.
@jenniferabraham4551
@jenniferabraham4551 2 жыл бұрын
I get "Error: Access is denied" when trying to send by gmail. Any thoughts on what is going wrong?
@lorenzokoerts4028
@lorenzokoerts4028 2 жыл бұрын
Gmail no longer supports unsafe sources and therefore blocks SMTP requests from excel
@techbuddy101
@techbuddy101 Жыл бұрын
Does it stillwork
@jiejenn
@jiejenn Жыл бұрын
It should.
@StevenSchiff-rg5ic
@StevenSchiff-rg5ic Жыл бұрын
I got the following error message. "Error: The requested body part was not found in this message" can you help please?
@jiejenn
@jiejenn Жыл бұрын
Your request body is missing a thing or two, that's my guess.
@StevenSchiff-rg5ic
@StevenSchiff-rg5ic Жыл бұрын
@@jiejenn thnak you for your reply... I entered exactly what your chatgpt instructions produced and I dont see anything missing...could the same question get 2 results for each of us?
@jiejenn
@jiejenn Жыл бұрын
@@StevenSchiff-rg5ic hard to tell without looking at your script.
@keesvandorsten5975
@keesvandorsten5975 4 жыл бұрын
Sadly doesn't work with excel 64-bit.
@jiejenn
@jiejenn 4 жыл бұрын
I did the video using Office 64bit, so Excel 64bit should work.
@irinkhan8114
@irinkhan8114 Жыл бұрын
When my email id is wrong (i.e, not found in mail address book),the macro stops running. What can be done to prevent thia as this prevents from sending my others mails to users in the same column??
Microsoft Access - Google REST API - Send Email via Gmail
41:30
D Pineault - Tech, Programming and more
Рет қаралды 875
How to send email using Gmail via Excel VBA
16:10
Dinesh Kumar Takyar
Рет қаралды 87 М.
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 25 МЛН
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 46 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
Excel VBA Macro: Send Email from a Specific Account (in Outlook)
7:00
Send Email From Excel Using VBA & Gmail
5:16
DontFretBrett
Рет қаралды 72 М.
5 Things I wish I knew When I started using Excel VBA
12:45
Excel Macro Mastery
Рет қаралды 336 М.
Send Multiple Emails From Excel
10:09
Excel Macro Mania
Рет қаралды 67 М.
🧙‍♂️ Top 15 Gmail Tips & Tricks
19:36
Kevin Stratvert
Рет қаралды 1,1 МЛН
TOO MANY EMAILS? Use THESE Proven Techniques | Outlook tips included
13:16
Что делать если в телефон попала вода?
0:17
Лена Тропоцел
Рет қаралды 3,2 МЛН
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 2,3 МЛН