Message Posted June 27, 2005 Posted June 27, 2005 Hi! I'm working on a script that will automatically send an email when a new file will save in a folder. But I have a problem to switch it in the background. I have this: RunWait($pathtogetmail & "\getmail.exe -u username -pw password -s pop3.server.com -delete -xtract -port 110") But this doesn't work RunWait($pathtogetmail & "\getmail.exe -u username -pw password -s pop3.server.com -delete -xtract -port 110", @SW_HIDE) Can somebody help me?
ning Posted June 27, 2005 Posted June 27, 2005 You need the working dir before the flags. From the help: RunWait ( "filename" [, "workingdir" [, flag]] ) So RunWait ("your command", "", @SW_HIDE) should work. ben
Message Posted June 28, 2005 Author Posted June 28, 2005 (edited) Thank you, that works! :-)But now I have another problem. Look at this code please:Func Send1() $attachment = "" While 1 $pdffile = FileFindNextFile($file) If @error then ExitLoop FileMove($source & '\' & $pdffile , $dest, 1) $attachment = $attachment & '"' & $pdffile & '", ' WEnd $attachment = StringLeft($attachment, StringLen($attachment) -2) If $smtpmethod = 1 then RunWait('"' & $blat egal.fil -to' & $to & '-subject ' & $subject & ' -ss -body ' & $message & ' -server ' & $smtp & ' -serverpop3 ' & $pop & ' -f ' & $from & '-i ' & $smtpname & '-port ' & $smtpport & ' -portpop3 ' & $popport & ' -u ' & $login & ' -pw ' & $pwd & ' -attachment ' & '$attachment & '"') Else RunWait('"' & $blat egal.fil -to' & $to & '-subject ' & $subject & ' -ss -body ' & $message & ' -server ' & $smtp & ' -f ' & $from & '-i ' & $smtpname & '-port ' & $smtpport & ' -pu ' & $login & ' -ppw ' & $pwd & ' -attachment ' & '$attachment & '"')The Error:Line 73: (File ... .au3)RunWait('" & $blat ^ ERROR...Unknown function name.Unknown function name.Do you know why it not works? Edited June 28, 2005 by Message
Message Posted June 30, 2005 Author Posted June 30, 2005 Or can anybody tell me how I can send an email with attachment automatically with another program? Please!
computergeek Posted June 30, 2005 Posted June 30, 2005 You could try writing a php script to do this and have it upload the files, and then call the page from autoit. But this is a sloppy method, and you might want to wait for a better reply.
Message Posted June 30, 2005 Author Posted June 30, 2005 You could try writing a php script to do this and have it upload the files, and then call the page from autoit. But this is a sloppy method, and you might want to wait for a better reply.<{POST_SNAPBACK}>Yes, I hope anyone can give me a "better" method to do this. Blat can do it, but I don't know how.
Valuater Posted June 30, 2005 Posted June 30, 2005 (edited) RunWait('"' & $blat egal.fil -to' & $to & '-subject ' & $subject. ^^ EDIT ... its late here 1 RunWait('"' & $blat egal.fil -to' & $to & '-subject ' & $subject. **should be RunWait( $blat... 2. depending on what $blat actually represents... maybe you need Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE) There are way too many variable combinations to know what is what in your "snipit" script above good luck 8) Edited June 30, 2005 by Valuater
Message Posted June 30, 2005 Author Posted June 30, 2005 Thanks Valuater. I only want to send an email automatically to only one emailadress with an attachment. The smtp Server needs a authorisation with my username + password. Maybe you have an Idea with fewer variables?
JSThePatriot Posted June 30, 2005 Posted June 30, 2005 Search the Scripts and Scraps forum for Blat. There is a UDF that (I dont remember who) someone made, that will do everything you require. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Message Posted July 1, 2005 Author Posted July 1, 2005 Search the Scripts and Scraps forum for Blat. There is a UDF that (I dont remember who) someone made, that will do everything you require.JS<{POST_SNAPBACK}>I can't find the script u talk about, so I search for another program to aend files with attachment in the commandline and found bmail. http://www.beyondlogic.org/solutions/cmdli...cmdlinemail.htmBut whats when the smtp server needs a authorization, I can't find a command for this in bmail. Do you know if its able to make an authorization?
MSLx Fanboy Posted July 1, 2005 Posted July 1, 2005 VBScript sends messages with attachments. I rewrote it a while back in AutoIt, however, last time I checked, it doesn't allow attachments. I'll play with it sometime this weekend...might be able to get a fix for it (*wink* jpm) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Message Posted July 1, 2005 Author Posted July 1, 2005 VBScript sends messages with attachments. I rewrote it a while back in AutoIt, however, last time I checked, it doesn't allow attachments. I'll play with it sometime this weekend...might be able to get a fix for it (*wink* jpm)<{POST_SNAPBACK}>Ok Thanks.Can you tell me where's the error here? I need a Commandline like this " c:\munpack -f -q file.msg"."file.msg" is a variable.Here's my code:RunWait('"' & $pathtodecode & '\munpack" "' & '-f' & '-q' & $source & '"',"",@SW_MAXIMIZE)I always get an empty commandline screen.
Message Posted July 2, 2005 Author Posted July 2, 2005 Ok Thanks.Can you tell me where's the error here? I need a Commandline like this " c:\munpack -f -q file.msg"."file.msg" is a variable.Here's my code:RunWait('"' & $pathtodecode & '\munpack" "' & '-f' & '-q' & $source & '"',"",@SW_MAXIMIZE)I always get an empty commandline screen.<{POST_SNAPBACK}>Wake up plz
MSLx Fanboy Posted July 2, 2005 Posted July 2, 2005 I don't know what munpack is? Is it a realprogram or something that you want to be an AutoIt script or something? Here is the VBS code Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.Sender = "me@my.com" objMessage.To = "test@paulsadowski.com" objMessage.TextBody = "This is some sample message text." objMessage.AddAttachment "c:\temp\readme.txt" '==Config== 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.myserver.com" 'Server port (typically 25) objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update '==End Config== objMessage.Send Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Message Posted July 3, 2005 Author Posted July 3, 2005 I don't know what munpack is? Is it a realprogram or something that you want to be an AutoIt script or something?munpack is a little program to make mime attachments.What can I do with the VBS Code? I think I need autoit code?
MSLx Fanboy Posted July 3, 2005 Posted July 3, 2005 The VBS code will do exactly what you want, the only thing that doesn't work right now in AutoIt is the AddAttachment line, but I haven't tested it on the latest beta version, so I'm not sure if that issue has been fixed yet. You can use AutoIt to automate the VBScript... Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Message Posted July 3, 2005 Author Posted July 3, 2005 But I get an error on line 1. set objmessage ... error: unknown function name
MSLx Fanboy Posted July 3, 2005 Posted July 3, 2005 Save it as a .vbs file, not au3. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Message Posted July 4, 2005 Author Posted July 4, 2005 Ok but what when the SMTP required my username + pass?
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