0

I've been looking everywhere for this answer and have had no luck! I went to http://www.jeffkastner.com/2010/01/blat-stunnel-and-gmail/ and followed it step by step. Stunnel installed, installed service and started service successfully but blat still does not work after setting it up.

I have a folder on my desktop C:\Users\Nicholas\Desktop\Games which is where the contents of blat is placed, and C:\Users\Nicholas\Desktop\Games\stunnel is where stunnel files are installed. And I also tried this when stunnel was installed to program files and it still did not work. I don't want blat installed to system32 because I have a batch file I'm using it with in C:\Users\Nicholas\Desktop\Games.

Online I try to find syntax for the blat -install but none of them work or at least I dont understand how it works. This is what I believe:

  1. You need to install your profile
  2. You send an email using the profile (ex: blat -p gmailsmtp ...) And thats it? It doesn't work for me.

I am willing to find an alternative to blat, but if you give an alternative please give a tutorial, not a suggestion.

Here are the install commands for blat I tried: (Which one should be working?)

blat -install smtp.gmail.com

blat -install smtp.gmail.com myemail@gmail.com -u username(does this include @gmail.com?) -pw password – - gmailsmtp

Here are email commands I tried:

blat -p gmailsmtp -to myemail@gmail.com -subject "subject text" -body "Body text" -server 127.0.0.1:1099

and a lot more commands that I can't remember.

Anyway, anyone find where I tripped here?

  • No error messages were given in your attempts? Here's another similar question http://stackoverflow.com/questions/709635/sending-mail-from-batch-file – user4317867 Feb 17 '15 at 01:35
  • Yes excuse me, is "SMTP server set to smtp.gmail.com on port 127.0.0.1:1099 with user , retry 1 time(s)" an error message? With "blat -to mail@example.com -server smtp.gmail.com -f mail@example.com -subject "subject" -body "body"" it returns "-to does not exist". But adding "Note.txt" following "blat" returns this and I do not know why... Sending stdin.txt (why not note.txt?) to myemail@example.com. Login name is myemail@example.com. Error: Can't resolve service.Error: Not a socket. – Nicholas Van Wie Feb 17 '15 at 04:09
  • A quick search resulted in http://blog.frogslayer.com/sending-an-email-through-google-smtp-via-windows-command-line/ which might have more information. Also the comments there may be useful. – user4317867 Feb 17 '15 at 04:50
  • Thank you @user4317867 , but sadly no luck. I think my computer is trying to connect to port 25 and I know it is blocked, I heard it needs to run through port 465, but how? If all fails, does anyone have a vbscript that can send a simple email? Trust me, I'll make any alternative for a batch script as long as it doesn't bring up a browser window. – Nicholas Van Wie Feb 17 '15 at 05:28

1 Answers1

0

Yes! I found a vbscript script that finally worked! On this thread, "Email sending not working", Miguel posted the following script

Sub SendGMail()

' Object creation
Set objMsg = CreateObject("CDO.Message") Set msgConf = CreateObject("CDO.Configuration")

' Server Configuration
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "user@gmail.com" msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
msgConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1 msgConf.Fields.Update

' Email
objMsg.To = "user@gmail.com" objMsg.From = "fromuser@domain.com" objMsg.Subject = "Test send with Gmail account" objMsg.HTMLBody = "HTML/Plain text message." objMsg.Sender = "Mr. Name"

Set objMsg.Configuration = msgConf

' Send
objMsg.Send

' Clear
Set objMsg = nothing
Set msgConf = nothing

End Sub

This script is working, but a lot of people still had problems, looking closer into the script I realized I didn't even recall the SendGMail()! To make this work I simply typed SendGMail() on the next line and BAM! I got an email! Thank you @user4317867 for helping me find my answer.

  • Happy to help, you can execute a script on the command line using `CSCRIPT.EXE` more help here https://technet.microsoft.com/en-us/library/bb490816.aspx – user4317867 Feb 17 '15 at 06:21