windows email from filepro
John Sica
john at chrismanncomputer.com
Fri Jan 31 02:09:28 UTC 2025
Hi Richard,
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.
From: https://github.com/austineric/Send-MailKitMessage
Go into Powershell as administrator and type: Install-Module -Name
"Send-MailKitMessage" -Scope AllUsers
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)
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.
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.
This uses port 587, and smtp.gmail.com as the smtp server.
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.
I use Google Workspace, so that's why it worked for me.
The sample text below has all the parameters, so I had to comment out
most of them to not get any errors.
I'm sure this could be run on one line but I didn't try that.
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.
Start Paste:
================================================================================
using module Send-MailKitMessage;
#use secure connection if available ([bool], optional)
$UseSecureConnectionIfAvailable = $true;
#authentication ([System.Management.Automation.PSCredential], optional)
$Credential =
[System.Management.Automation.PSCredential]::new("richard at appgrp.net",
(ConvertTo-SecureString -String "PASSWORD" -AsPlainText -Force));
#SMTP server ([string], required)
$SMTPServer = "smtp.gmail.com";
#port ([int], required)
$Port = 587;
#sender ([MimeKit.MailboxAddress]
http://www.mimekit.net/docs/html/T_MimeKit_MailboxAddress.htm, required)
$From = [MimeKit.MailboxAddress]"richard at appgrp.net";
#recipient list ([MimeKit.InternetAddressList]
http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm,
required)
$RecipientList = [MimeKit.InternetAddressList]::new();
$RecipientList.Add([MimeKit.InternetAddress]"richard at appgrp.net");
#cc list ([MimeKit.InternetAddressList]
http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm,
optional)
#$CCList = [MimeKit.InternetAddressList]::new();
#$CCList.Add([MimeKit.InternetAddress]"CCRecipient1EmailAddress");
#bcc list ([MimeKit.InternetAddressList]
http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm,
optional)
#$BCCList = [MimeKit.InternetAddressList]::new();
#$BCCList.Add([MimeKit.InternetAddress]"BCCRecipient1EmailAddress");
#subject ([string], optional)
$Subject = [string]"Subject";
#text body ([string], optional)
$TextBody = [string]"TextBody";
#HTML body ([string], optional)
$HTMLBody = [string]"HTMLBody";
#attachment list ([System.Collections.Generic.List[string]], optional)
#$AttachmentList = [System.Collections.Generic.List[string]]::new();
#$AttachmentList.Add("Attachment1FilePath");
#splat parameters
$Parameters = @{
"UseSecureConnectionIfAvailable" = $UseSecureConnectionIfAvailable
"Credential" = $Credential
"SMTPServer" = $SMTPServer
"Port" = $Port
"From" = $From
"RecipientList" = $RecipientList
"CCList" = $CCList
"BCCList" = $BCCList
"Subject" = $Subject
"TextBody" = $TextBody
"HTMLBody" = $HTMLBody
# "AttachmentList" = $AttachmentList
};
#send message
Send-MailKitMessage @Parameters;
======================================================================
John
On 1/30/2025 3:59 PM, Richard D. Williams via Filepro-list wrote:
> Does anyone have any windows program to send emails using a .bat from
> filepro?
>
> Thunderbird command line works, but you must click send on each email.
> I need batch tool to be set in the Task Schedule.
>
> Richard D. Williams
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at mailman.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> https://mailman.celestial.com/mailman/listinfo/filepro-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20250130/49d93ceb/attachment.html>
More information about the Filepro-list
mailing list