Here's the error? any ideas?Īt C:\ibex\utils\extract\dailymail.ps1:7 char:13
Send inkpad notepad to eamil code#
looks like a syntax error, but i copied exactly the code from before. I tried doing the powershell script and am getting the following error. The above is offered to you as A CLUE on how you can acheive things but you will need to read, understand and adapt the methods to suit your monitoring processes. Set /p "SendFile=Attachment -> "Ĭscript.exe //NoLogo VBSEmailer.vbs /SendFrom:%emailFrom% /SendFromAddress:%emailFrom% /SendAddRecipient:%emailRecipient% /SendSubject:"%subj%" /SendBody:"%body%" /SendFile:%SendFile% Set /p "emailRecipient=Email Recipient -> " Rem * It calls VBSEmailer.vbs to do the work (which also logs to Emailer.log) Rem * This script is a result of testing to create a method alternative to using Blat.exe The above can be called with the following bat: MyLog.WriteLine now & " -End of Session-" ContentTransferEncoding = "quoted-printable"įlds("urn:schemas:mailheader:content-disposition") = "attachment filename="""&SendFileTrim&"""" '=End remote SMTP server configuration section=įlds("urn:schemas:mailheader:content-type") = "text/html" 'Use SSL for the connection (False or True) Set objMessage = CreateObject("CDO.Message") MyLog.WriteLine "Attached text file: " & SendFileĬonst cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.Ĭonst cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).Ĭonst cdoAnonymous = 0 'Do not authenticateĬonst cdoBasic = 1 'basic (clear-text) authentication MyLog.WriteLine "From: " & SendFromAddress MyLog.WriteLine "Subject: " & SendSubject MyLog.WriteLine "Sending " & SendFile & " to " & SendAddRecipient MyLog.WriteLine now & " -Start of Session-" Set myLog = objFSO.CreateTextFile(strLogFileName) Set myLog = objFSO.OpenTextFile(strLogFileName, 8, True) If objFSO.FileExists(strLogFileName) Then SendFileTrim = objFSO.GetFileName(SendFile) Set objFSO = CreateObject("Scripting.FileSystemObject") StrLogFileName = "C:\Users\Administrator\Documents\BatchFiles\emailer.log" Rem * It is CALLED by VBSEmailer.bat (which passes all the parameters) Rem * The conclusion is that this WORKS! But it doesnt give anything more/better than what Blat does. Rem * be attached to the sending emial and appear 'Inline' (as was possible with Blat). Rem * In particular it was necessary to be able to attach a Text file (eg, Log file) that would Rem * It needed to be able to calling to send an email whilst being unreliant/outside of hmailserver API. Code: Select all rem * This script is a result of testing to create a method alternative to using Blat.exe