This package provides a command line interface for sending emails via Gmail's SMTP server. It also provides a Python and C# method to send emails.
This package will only work with emails provided through Gmail.
Remember to # to your account and then go to this link to allow less secure apps to access your email.
- Clone this repository to your computer
- OPTIONAL: Add the win32 directory to your PATH enviornment variable. Now, this command line script may be executed from any directory.
- If you did not add the win32 directory to your PATH, navigate to the win32 directory.
- Execute the following command: sendMail [subject] [body] [from] [to] [password]
- EXAMPLE:
sendMail "test" "This is a test." "me@gmail.com" "you@example.com" "mygmailpassword"
- Install python if you don't already have it
- Clone this repository to your computer
- Navigate to the python directory
- Execute the following command: python commandline.py [subject] [body] [from] [to] [password]
- EXAMPLE:
python commandline.py "test" "This is a test." "me@gmail.com" "you@example.com" "mygmailpassword"
How To Import The Python Script Into Your Another Python Package (For Use In Your Python Applications):
- Clone this repository to your computer
- Copy the file "main.py" into your python application
- Import the sendMail function from "main.py" by using the following python syntax:
from main import sendMail
- Clone this repository to your computer
- Copy the DLL compiled for the version of .NET corresponding to your project into your project's references
- Add the following "using" statement to your code:
using Email;
- To send an email, first declare an email message object with the following syntax:
EmailMessage message = new EmailMessage('subject', 'body', 'from', 'to', 'password');
- Send the message with:
message.Send();
- If you are using .NET 5+, you can send the message with await:
await message.SendAsync();