Hello Guest it is September 15, 2019, 09:22:17 PM

Author Topic: Any way I can get Mach to send me an email when it's finished?  (Read 4020 times)

0 Members and 1 Guest are viewing this topic.

Is is possible to hook up a bit of VB to M5 to send me an email letting me know mach has finished?

I can think about 6 ways to make a linux machine send me an email -  but windows and VB are a mystery...

Offline Jeff_Birt

*
  •  1,107 1,107
    • View Profile
    • Soigeneris
Re: Any way I can get Mach to send me an email when it's finished?
« Reply #1 on: May 12, 2009, 09:29:38 AM »
I'm not sure under the Cypress flavor of VB that mach uses. It can call other libraries though. I would do some googling on sending email in VB script or VB 6. That should be pretty close. I have some code around somewhere for VB.NET that I used for an introductory class on VB. If I can find it I'll post it.

I just found lots of info searching for 'VBscript send email', here is one:
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/enterprise/mail/
« Last Edit: May 12, 2009, 09:34:57 AM by Jeff_Birt »
Happy machining , Jeff Birt
 
Re: Any way I can get Mach to send me an email when it's finished?
« Reply #2 on: May 12, 2009, 08:38:27 PM »
That looks similar to the code I found....

here's my new M5 script works when run manually - haven't tried it from a real job yet - obviously replace username, password, server, and email addresses. It's probably possible to omit the username and password but I don't have an email client setup on the computer running mach...



=====================
DoSpinStop()
Code "(sending mail)"

Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "mach finished"
objMessage.Sender = "youremail@blah.com"
objMessage.To = "youremail@blah.com"
objMessage.TextBody = "mach finished."
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.server.com"

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
'objMessage.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic

'Your UserID on the SMTP server
'objMessage.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"

'Your password on the SMTP server
'objMessage.Configuration.Fields.Item _
'("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

objMessage.Configuration.Fields.Update
objMessage.Send

Re: Any way I can get Mach to send me an email when it's finished?
« Reply #3 on: May 13, 2009, 10:37:02 AM »
Here's an idea...

Just mount a cellphone to the table, and at the end of your program have the spindle stop and rapid over to the phone and dial your number.  ;D
Re: Any way I can get Mach to send me an email when it's finished?
« Reply #4 on: May 13, 2009, 11:00:21 AM »
Neat idea !  :D
Would look good on YouTube too ! ;D

Offline Sam

*
  • *
  •  988 988
    • View Profile
    • hillbillyhilton.com
Re: Any way I can get Mach to send me an email when it's finished?
« Reply #5 on: May 13, 2009, 09:26:45 PM »
HAHAHA!!! I got a good laugh outta that one. Thanks.
"CONFIDENCE: it's the feeling you experience before you fully understand the situation."

Offline Chaoticone

*
  • *
  •  5,589 5,589
  • Precision Chaos
    • View Profile
Re: Any way I can get Mach to send me an email when it's finished?
« Reply #6 on: May 13, 2009, 09:36:03 PM »
 ;D

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!