Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Blat DLL Usage


  • Please log in to reply
39 replies to this topic
Atomhrt
  • Members
  • 124 posts
  • Last active: Nov 13 2006 09:18 PM
  • Joined: 02 Sep 2004
Blat is a small, efficient SMTP command line mailer for Windows. It is the SMTP *sending* part of an eMail User Agent (MUA) or eMail client. As such, Blat sends eMail via SMTP (or internet eMail) from the command line.

Link to Blat home page:
http://www.blat.net/

Syntax:
http://www.blat.net/syntax/syntax.html

*Very* simple blat.dll script that sends the ahk script and blat.dll to the "addy" email address:
teststring:="blat-test.ahk -t [email protected] -s test -base64 -attach blat.dll -f [email protected] -server smtpserver.pub.net"
i:=DllCall("blat.dll\Send",str,teststring)

You can get the dll from here:
http://www.geocities...toby_korn/blat/

I created the scipt with the intention of sending the output of another ahk script to a couple of email addresses.
I am he of whom he speaks!

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
I guess its function is to send a given file to a given email address. Right? Could you add a little explanation of the options or a link, where we can find them? An example application would be also nice. Many of us don't know why we would email files from an AHK script.

Atomhrt
  • Members
  • 124 posts
  • Last active: Nov 13 2006 09:18 PM
  • Joined: 02 Sep 2004

I guess its function is to send a given file to a given email address. Right? Could you add a little explanation of the options or a link, where we can find them? An example application would be also nice. Many of us don't know why we would email files from an AHK script.


Sorry about that. I was in a hurry when I made the original post. I've updated it with more info. Hope that helps.
I am he of whom he speaks!

silveredge78
  • Members
  • 499 posts
  • Last active: Mar 14 2014 03:19 AM
  • Joined: 25 Jul 2006
Laslo, I use the email sending capabilities of blat in a couple of my scripts, particularly my Server Status Check script. It sends me an email to my cell phone, which comes across as a SMS text message. Rather handy for knowing when servers appear to not be responding.

Or in the case of another custom script, it pages me via the email feature of blat, to let me know when a particular program failed to restart properly.

These notifications are handy as it lets me know I need to look into what is going on. The same principle would be good for just normal email notifications, for followup purposes. :)
SilverEdge78

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
What is the benefit of using the dll over the command line tool?
I used the CLI in one of my scripts and it works ok.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

silveredge78
  • Members
  • 499 posts
  • Last active: Mar 14 2014 03:19 AM
  • Joined: 25 Jul 2006
Now that I cannot answer. I use the CLI myself. I do not care for DllCalls if I do not have to use them. I was merely addressing Laszlo's question as to why someone would want to email from an AHK script. :)
SilverEdge78

Atomhrt
  • Members
  • 124 posts
  • Last active: Nov 13 2006 09:18 PM
  • Joined: 02 Sep 2004

What is the benefit of using the dll over the command line tool?
I used the CLI in one of my scripts and it works ok.


Because you are not involving the command shell (cmd.exe) for one thing. An example of why this may be important... A bat file that ran fine on lots of other machines was bombing on three. We finally tracked it down to a registry setting that the user had set in the Command Processor tree. We decided not to use a bat file for the tool.
I am he of whom he speaks!

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Thanks Atomhrt and silveredge78 for the explanations. I am convinced now that Blat dll is a useful tool. Especially, sending an SMS automatically can be very helpful.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006

I was merely addressing Laszlo's question as to why someone would want to email from an AHK script.

What kind of question is this ?
There are number of uses...
Posted Image

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005

There are number of uses...

It was interesting to here about a few. Why don't you tell about your application? Most of us use a single computer and our employers don't allow sending automated emails. Some people's first reaction about auto-sending emails could be that it is for spam.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Only few:

1. Reporting GUI for bugs
2. Automatic annoucement of certain events :
    2.1. send ip on starting the machine
    2.2. send application logs
    2.3. birthday robots

3. Send spams :)
4. Make the people nervous 8)
5. order pica for your breakfast at scheduled time
6. ....
Posted Image

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Other use I though of when I was searching for a job: as last resort, when you discover lot of potential emplyers just don't read your messages, don't answer to them, or use robots to answer them:
Send automated e-mail job applications.
Not dumb spam, but fill in a base of data on the targetted job, and send the more or less personnalized e-mails.
At the end, I had a standard e-mail which I adjusted slightly to the profile anyway... :-)

Of course, for really interesting offers, I spent more time to polish the message... ;-)
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
So you see Laszlo, from ordering a piza to find a new job... :p
Posted Image

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
It was a long time ago... I wanted to apply for many jobs (it was 170 at the end), so I wrote a TeX macro with input parameters like the job title, reference code, the contact person with the proper salutation, address, my expertise, etc. It printed professional looking letters, which I signed and mailed. (Still, I got only a handful of replies.)

The last time I did a similar process with Word macros. I could create a good looking application email in seconds, but before I sent them, I had to check for inconsistencies, formatting, etc. The actual sending of the email was the least of the problems, you can do it directly from Word. However, with Blat and an AHK script (hotkey stripping the email address and send the selected text after saving it for later reference), this last step could have been simplified. I said I was already convinced automatic email sending is useful.

majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
Ok, so we are all very happy about this dll. :D
Posted Image