Sending E-Mail and AutoHotkey

After Working Out the Kink’s, AutoHotkey Sends Individual E-Mails Smoothly

RobotEmailCartoon

The scourge of the Internet, Spam haunts our daily lives—whether in the form of phishing e-mails or unwanted phone calls. While never eliminated, we minimized its impact through filtering and blocking. As a side effect of our efforts, we now commonly check our Spam folder when searching for an errant missive. Due to this problem e-mail providers now add layers of protection to their servers—usually in the form of what content we can transmit, message size, and the number of e-mails sent in a specific period of time.

Generally, we never think about these limitations because our local e-mail program restricts us enough to prevent our abusing the system. This confines us safely within the parameters of our e-mail provider. Only setting up our own e-mail server removes these restrictions.

It is important to understand that sending a mass email through your Gmail does have some limits (a total of more than 500 recipients in a single email and or more than 500 emails sent in a day). There is a maximum of email recipients a user can have in one single email, as well as a maximum amount of emails a user can send in 24 hours. It will not work by sending them at 11:50 pm and again at 12:05 am; the system requires a full 24 hours to pass.

How to Send Mass Email in Gmail – Few Easy Options
Continue reading

Adapting Web Scraping Routines to Changing Web Pages (AutoHotkey Tip)

When the Horoscope Web Page I Use for E-mails Altered Its Format, I Quickly Adjusted the Script

Last year, I wrote a script that e-mails a daily horoscope to my wife, “E-mail the Daily Horoscope to Yourself (AutoHotkey Trick).” Every morning she receives on her tablet an e-mail containing her daily horoscope. (I don’t send it to myself because I don’t want to know that much about my future—and I don’t listen to advice.) Recently, she pointed out that the e-mail started coming up blank. I immediately realized that the target Web site had changed its source code. (I’ve experienced the same problem with the SynonymLookup.ahk script.) I knew I could repair the Regular Expression (RegEx) in the broken script fairly quickly by following some basic steps:

  1. Access the source code for the target Web page and locate the key text.
  2. Copy the critical portion of the source code, including any unique HTML tags surrounding the target text, then paste the selection into Ryan’s RegEx Tester.
  3. Adjust the RegEx to include key unique tags surrounding the text—then extracting the paragraph.
  4. In the script, replace the old RegEx found in the RegExMatch() function with the new one from Ryan’s RegEx Tester.
  5. Make any necessary adjustments to the RegEx—primarily escaping double quotation marks.

The new horoscope e-mail script now includes more details and a link to the site.
Continue reading

AutoHotkey Tips of the Week: The ComObjCreate() Function for Web Page Downloads, E-Mail, and Text Audio

While AutoHotkey Directly Supports Most Windows Features, the Flexibility of the ComObjCreate() Function Adds More Useful Capabilities—Especially for Capturing Web Data, Sending E-mail, and Reading Text Out-Loud

A number of my scripts use the ComObjCreate() function in various forms. Most of them I copied from the AutoHotkey Forums and modified for my own purposes. In this blog, I highlight the ComObjCreate() applications I use most, then offer a list of other forms of the function you may find useful.

How I Use ComObjCreate()

Synonym Page
The SynonymLookup.ahk script pulls replacement terms for the highlighted word “Page” from the Web.

While AutoHotkey supports many of these features in one form or another, directly accessing the COM (Component Object Model) might provide a solution you can get by no other method. I use the ComObjCreate() function in three ways:

  1. Collect data from Web pages (ComObjCreate(“WinHttp.WinHttpRequest.5.1”)).
  2. Send e-mail directly from an AutoHotkey script (ComObjCreate(“CDO.Message”))—no mail program required.
  3. Use the computer voice to read text (ComObjCreate(“SAPI.SpVoice”)).

While I haven’t found much additional information about the ComObjCreate() function posted on the new AutoHotkey forum, the old forum contains a useful COM Object reference list. You don’t need to know how they work—just how to use them. Continue reading