<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hi Richard,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">If you go into powershell as
administrator and download the new powershell command line program
called Send-MailKitMessage, you will be able to send mail from a
system command in filepro.</div>
<div class="moz-cite-prefix">From:
<a class="moz-txt-link-freetext" href="https://github.com/austineric/Send-MailKitMessage">https://github.com/austineric/Send-MailKitMessage</a><br>
</div>
<div class="moz-cite-prefix">Go into Powershell as administrator and
type: Install-Module -Name "Send-MailKitMessage" -Scope AllUsers</div>
<div class="moz-cite-prefix">Create a file (I'll call it and ini
file) but it's an environment file like a muttrc file (I called it
send2.ps1)<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">This sample file I just used to send an
email to myself by being in a powershell prompt and typing
.\send2.ps1 while in my C:\batch directory.</div>
<div class="moz-cite-prefix">This works with a gmail account. I
typed in your email address below so that you could test this by
entering your password in the "PASSWORD" field.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">This uses port 587, and smtp.gmail.com
as the smtp server.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">You will probably have to have set up
the gmail account to "Use Less Secure Apps" if it isn't already
set up that way.<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I use Google Workspace, so that's why
it worked for me.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">The sample text below has all the
parameters, so I had to comment out most of them to not get any
errors.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I'm sure this could be run on one line
but I didn't try that.</div>
<div class="moz-cite-prefix">If your client has Office 365 email
these settings would have to change, and you would have to enable
SMTP in the "Advanced" section in the client's email account
properties. Much like you would for an account that a
Multifunction device uses to send emails to recipients.<br>
</div>
<div class="moz-cite-prefix">Start Paste:</div>
<div class="moz-cite-prefix">================================================================================</div>
<div class="moz-cite-prefix">using module Send-MailKitMessage;<br>
<br>
#use secure connection if available ([bool], optional)<br>
$UseSecureConnectionIfAvailable = $true;<br>
<br>
#authentication ([System.Management.Automation.PSCredential],
optional)<br>
$Credential =
[System.Management.Automation.PSCredential]::new(<a class="moz-txt-link-rfc2396E" href="mailto:richard@appgrp.net">"richard@appgrp.net"</a>,
(ConvertTo-SecureString -String "PASSWORD" -AsPlainText -Force));<br>
<br>
#SMTP server ([string], required)<br>
$SMTPServer = "smtp.gmail.com";<br>
<br>
#port ([int], required)<br>
$Port = 587;<br>
<br>
#sender ([MimeKit.MailboxAddress]
<a class="moz-txt-link-freetext" href="http://www.mimekit.net/docs/html/T_MimeKit_MailboxAddress.htm">http://www.mimekit.net/docs/html/T_MimeKit_MailboxAddress.htm</a>,
required)<br>
$From = [MimeKit.MailboxAddress]<a class="moz-txt-link-rfc2396E" href="mailto:richard@appgrp.net">"richard@appgrp.net"</a>;<br>
<br>
#recipient list ([MimeKit.InternetAddressList]
<a class="moz-txt-link-freetext" href="http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm">http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm</a>,
required)<br>
$RecipientList = [MimeKit.InternetAddressList]::new();<br>
$RecipientList.Add([MimeKit.InternetAddress]<a class="moz-txt-link-rfc2396E" href="mailto:richard@appgrp.net">"richard@appgrp.net"</a>);<br>
<br>
#cc list ([MimeKit.InternetAddressList]
<a class="moz-txt-link-freetext" href="http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm">http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm</a>,
optional)<br>
#$CCList = [MimeKit.InternetAddressList]::new();<br>
#$CCList.Add([MimeKit.InternetAddress]"CCRecipient1EmailAddress");<br>
<br>
#bcc list ([MimeKit.InternetAddressList]
<a class="moz-txt-link-freetext" href="http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm">http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm</a>,
optional)<br>
#$BCCList = [MimeKit.InternetAddressList]::new();<br>
#$BCCList.Add([MimeKit.InternetAddress]"BCCRecipient1EmailAddress");<br>
#subject ([string], optional)<br>
$Subject = [string]"Subject";<br>
<br>
#text body ([string], optional)<br>
$TextBody = [string]"TextBody";<br>
<br>
#HTML body ([string], optional)<br>
$HTMLBody = [string]"HTMLBody";<br>
<br>
#attachment list ([System.Collections.Generic.List[string]],
optional)<br>
#$AttachmentList =
[System.Collections.Generic.List[string]]::new();<br>
#$AttachmentList.Add("Attachment1FilePath");<br>
<br>
#splat parameters<br>
$Parameters = @{<br>
"UseSecureConnectionIfAvailable" =
$UseSecureConnectionIfAvailable <br>
"Credential" = $Credential<br>
"SMTPServer" = $SMTPServer<br>
"Port" = $Port<br>
"From" = $From<br>
"RecipientList" = $RecipientList<br>
"CCList" = $CCList<br>
"BCCList" = $BCCList<br>
"Subject" = $Subject<br>
"TextBody" = $TextBody<br>
"HTMLBody" = $HTMLBody<br>
# "AttachmentList" = $AttachmentList<br>
};<br>
<br>
#send message<br>
Send-MailKitMessage @Parameters;<br>
======================================================================</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">John</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><span
style="color: rgb(31, 35, 40); font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; font-size: 13.6px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: break-spaces; background-color: rgba(129, 139, 152, 0.12); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
</span></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 1/30/2025 3:59 PM, Richard D.
Williams via Filepro-list wrote:<br>
</div>
<blockquote type="cite"
cite="mid:fbe351d4-ea52-44fe-9705-28977f8dbc21@appgrp.net">Does
anyone have any windows program to send emails using a .bat from
filepro?
<br>
<br>
Thunderbird command line works, but you must click send on each
email.
<br>
I need batch tool to be set in the Task Schedule.
<br>
<br>
Richard D. Williams
<br>
<br>
_______________________________________________
<br>
Filepro-list mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Filepro-list@mailman.celestial.com">Filepro-list@mailman.celestial.com</a>
<br>
Subscribe/Unsubscribe/Subscription Changes
<br>
<a class="moz-txt-link-freetext" href="https://mailman.celestial.com/mailman/listinfo/filepro-list">https://mailman.celestial.com/mailman/listinfo/filepro-list</a>
<br>
</blockquote>
<p><br>
</p>
</body>
</html>