Here you can see how to send mails form C language code
Clone or Download the repo
If you have downloaded the zip, then extract it and if you have cloned then open the folder
Now you will find a file named Mail.h
Copy it and paste it into
Your GCC compiler's include folder
Ex. If you are using Dev-Cpp Then goto "C:\Program Files(x86)\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include"
and paste it.
Now just open the file Example.cpp
And Run it.
Enable 2 step authentication in gmail form which you will be sending email
Below 2 step authentication you will se app password go there i. In Select app select mail ii.Select custom and enter "SMTP" (you can enter whatever you want).
Press generate Now you will see a password enter that password in PassUR.txt You are good to go now.
Remember: When You Are Including This Library, Before It You Must Also Include stdio.h, stdlib.h and conio.h then Mail.h.
The First Few Lines Of Your Code Must Be
#include <stdio.h>
#include <stdlib.h>
#include <Mail.h>
This library has 3 Methods
- Init();
- fillDat();
- SendMail();
First of all make sure that you have turned on less secure app access on your account, click here to turn it on.
We must run Init() while starting the code, means at the time when you start to write down the code.
We need python so download it from here
Queries? Watch our video tutorial
Remember, we make use of python in background to make process easier