jlandes Posted March 29, 2004 Share Posted March 29, 2004 Since AutoIt is a language designed to automate tasks in Windows, it is sometimes used as a means to schedule processes to run. I know that I have found a need on multiple occasions to send e-mail from a script that gives information about the scripts execution, much like a log file. It would be beneficial to everyone, I think, if there were an internal command that could be used to send an e-mail message using the SMTP protocol. A function that has syntax similar to this would be sufficient for accomplishing this task: MailSend ( "SMTP Host", "From Address", "To Addresses", "Subject", "Message Body" ) What does everyone think? I don't think we need to worry about the ability to include an attachment, although it would be nice. In addition, I don't even care if it supports sending HTML e-mails, just as long as I can send an e-mail from within a script without having to use something like Blat to do so. Is this something that can be done? Sincerely yours,Jeremy Landesjlandes@landeserve.com Link to comment Share on other sites More sharing options...
Administrators Jon Posted March 29, 2004 Administrators Share Posted March 29, 2004 No way. Virus scanners are all over files that contain SMTP functions. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Lazycat Posted March 30, 2004 Share Posted March 30, 2004 There are lots of good console programs that can to send/receive emails. For example ZeRAT (40 kb). This is share, but I think free analogs also exists. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
bcording Posted March 30, 2004 Share Posted March 30, 2004 RunMail3 is great for scripting since it has a built in SMTP server. It's freeware, but i think it's no longer being developed. Link to comment Share on other sites More sharing options...
ezzetabi Posted March 30, 2004 Share Posted March 30, 2004 Jon, virus scanner attacks also program that do not have a SMTP server included?jlandes seems not interested about this...Blat is an other mail sender.http://www.interlog.com/~tcharron/blat.html Link to comment Share on other sites More sharing options...
etn Posted March 30, 2004 Share Posted March 30, 2004 Newer blat version on SourceForge. Link to comment Share on other sites More sharing options...
Chris_1013 Posted March 31, 2004 Share Posted March 31, 2004 I've wanted for ages a way for a script to send an e-mail. Using a command line tool would be fine, but I can't find anything to work within an Exchange set-up (ie, using MAPI to send the e-mail I guess). Link to comment Share on other sites More sharing options...
Chris_1013 Posted March 31, 2004 Share Posted March 31, 2004 RunMail3 is great for scripting since it has a built in SMTP server. It's freeware, but i think it's no longer being developed.Why do you have to install a command line tool? Seems dodgy to me! Link to comment Share on other sites More sharing options...
scriptkitty Posted March 31, 2004 Share Posted March 31, 2004 I use a lot of command line tools. I like AutoIt's small size and ability to do almost anything I need. The fact that I can add in SMTP or almost any other thing I need is a great feature. I have used BLAT many times in my AutoIt scripts, as well as a few dozen command line tools. The nice part is that I only need to add the additional size when I have a need for it. But I am not the one who puts AutoIt on the scale to wiegh its size. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
jlandes Posted March 31, 2004 Author Share Posted March 31, 2004 I've wanted for ages a way for a script to send an e-mail. Using a command line tool would be fine, but I can't find anything to work within an Exchange set-up (ie, using MAPI to send the e-mail I guess).If you can get access to either the Exchange Resource Kit or BORK (Back Office Resource Kit), look for a tool called MAPISEND.EXE. You might be able to find a copy on the Internet somewhere. Here's an article that describes this utility:How can I send a mail message from the command line?Hope this helps. Thx. Sincerely yours,Jeremy Landesjlandes@landeserve.com Link to comment Share on other sites More sharing options...
Chris_1013 Posted April 1, 2004 Share Posted April 1, 2004 If you can get access to either the Exchange Resource Kit or BORK (Back Office Resource Kit), look for a tool called MAPISEND.EXE.Cool, I'm definately gonna check that out when I get to work.Thanks Link to comment Share on other sites More sharing options...
jlandes Posted April 1, 2004 Author Share Posted April 1, 2004 Jon, If you don't want to include an SMTP function, I can understand your reasons. Would it be possible to include a MAPISend function? Some of the newer releases of Outlook prompt the user as to whether they want to continue sending the e-mail or not. I'm just curious. Thx. Sincerely yours,Jeremy Landesjlandes@landeserve.com Link to comment Share on other sites More sharing options...
jgshier Posted April 1, 2004 Share Posted April 1, 2004 I just call a vbs script at the end of auto it so I know it's done. Run("cscript \\server\sendmail\sendmail.vbs Subject") -------------------------------------------- sendmail.vbs Dim strUser Dim strSubject ParseCommandLine() Set WshNetwork = WScript.CreateObject("WScript.Network") Set WshShell = WScript.CreateObject("WScript.Shell") Subject = strSubject User = WshNetwork.UserName ComputerName = WshNetwork.ComputerName 'Sending a text email using a remote server User = User & "@something.com" 'wscript.echo User & " " & ComputerName Call Send(User, ComputerName, Subject) Sub Send(User, ComputerName, Subject) Set objMessage = CreateObject("CDO.Message") objMessage.Subject = Subject objMessage.From = User 'edit the To objMessage.To = "me" 'objMessage.TextBody = "Testing Email Service" objMessage.HTMLBody = "<h1>" & Subject & " Update Done on Computer: " & "<font color='#FF0000'>" & ComputerName & "</font></h1>" 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") = "192.168.10.2" 'Server port (typically 25) objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update objMessage.Send End Sub Sub ParseCommandLine() Dim vArgs set vArgs = WScript.Arguments if vArgs.Count <> 1 then DisplayUsage() Else strSubject = vArgs(0) End if End Sub Sub DisplayUsage() WScript.Echo WScript.Echo "Usage: cscript.exe " & WScript.ScriptName & " <Subject>" WScript.Echo "Example: cscript " & WScript.ScriptName & " " & chr(34) & "Subject here" & chr(34) WScript.Quit(0) End Sub Link to comment Share on other sites More sharing options...
Chris_1013 Posted April 2, 2004 Share Posted April 2, 2004 Some of the newer releases of Outlook prompt the user as to whether they want to continue sending the e-mail or not.Yeah, and what a bugger it is too! I've tried using Mapisend.exe and I like it, except for the fact that Outlook causes that warning to pop up, and from what I see I can't get round it. Well, not easily anyways. Link to comment Share on other sites More sharing options...
Davarious Posted August 17, 2007 Share Posted August 17, 2007 Yeah, and what a bugger it is too! I've tried using Mapisend.exe and I like it, except for the fact that Outlook causes that warning to pop up, and from what I see I can't get round it. Well, not easily anyways.Here is a means to get around the outlook dialog box...http://www.contextmagic.com/express-clicky...ree-version.htm Link to comment Share on other sites More sharing options...
sogard Posted October 8, 2007 Share Posted October 8, 2007 (edited) No way. Virus scanners are all over files that contain SMTP functions.Not really. The fact that has a SMTP function will probably don't make it detected. But as soon as the first smart guy start using in in a virus, the antivirus vendors will be forced to detect AutoIT as "dangerous application" or "security private risk". This happened to some ftp servers and remote administration programs. Also the way it has been requested seems that you want to use some open relay this will definitely look dubious. If you really need it without relaying on some 3th party tool, I recommend scripting Internet explore to send the email. This shouldn't be so hard, I think some snippets are already availed to sign up to MSN. Just paste the email and click send. Edited October 8, 2007 by sogard Link to comment Share on other sites More sharing options...
jvanegmond Posted October 10, 2007 Share Posted October 10, 2007 Bmail is also great for sending e-mails. It even works on Win 95 computers, instead of CDO.Message. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now