I’m looking for a simple Windows script that can automatically send a short email message to Gmail addresses. I’ve experimented with several command-line tools like BLAT but haven’t had success getting them to work properly. The script needs to run from within a Windows batch file when specific conditions are triggered. I’m flexible with the scripting language - whether it’s Python, Perl, VBScript, Java, or anything else that can be called from a batch file. My setup involves sending from one Gmail account to another Gmail account. I need a solution that actually works with Gmail’s current security settings. Has anyone successfully implemented something similar and can share a working example?
Had this same problem last year. Ended up using Python’s smtplib library - worked great once I figured out the auth stuff. You can’t use your regular Gmail password anymore. Go to your Google Account settings and generate an App Password instead. My script connects with smtplib.SMTP_SSL to smtp.gmail.com on port 465, then authenticates with that app password. Call it from batch files with python script.py and pass whatever parameters you need. Takes about 30 minutes to set up once you know about the app password thing. Gmail will block everything if you try using your regular password.
VBScript handles this really well if you’re comfortable with it. I’ve used CDO.Message for automated Gmail sending from batch files for two years now. You just need to configure SMTP authentication properly - set it up for smtp.gmail.com, port 587 with TLS, and your Gmail credentials. Like others said, you definitely need an app-specific password, not your regular Gmail password. VBScript’s already built into Windows, so no extra installs needed. Save your VBS file and call it from your batch script with cscript emailsender.vbs. Works great with Gmail’s current security and handles HTML formatting too.
i totally agree, PowerShell is way simpler! just remember to set your SMTP settings right and don’t forget that app password. makes life much easier. good luck!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.