Alan:

That's great! I've been banging the drum for "SMTP Good, MAPI Bad" for
a long, long time, but not having good/simple tools for handling
SSL.TLS was a big hangup. Now that MS is _finally_ gaining a decent
shell with PowerShell, this is a cool tool to add to the arsenal.

On Thu, Nov 12, 2015 at 5:01 AM, Alan Bourke <[email protected]> wrote:
> As part of researching a project I noticed that PowerShell has a cmdlet
> called Send-MailMessage which can send an SMTP mail.
>
> It supports HTML body or plain text, multiple recipients,
> attachments, priority, failure notification, SSL/TLS and SMTP
> authentication if needed.
>
> (I suspect it is using the .Net System.Net.Mail.SmtpClient namespace
> internally)
>
> I have knocked up a quick class to demonstrate how to use it to send
> SMTP email on the VFP Wiki:
> http://fox.wikis.com/wc.dll?Wiki~SendSmtpEmailWithPowershell
>
> Broadly speaking the class wraps functionality that will generate a
> PowerShell script file (.PS1) and then run that using Windows
> Scripting Host.
>
> One drawback is that it doesn't support inline images. So to include an
> image in a HTML body you need to use an image tag with a resolvable URL
> to the image, meaning resolvable by the recipient so either in a public
> location on your own server, or on a third-party content server.
>
> The way round that is inline images, where you add an inline image and
> then just refer to it with a ContentID in the <img> tag, i.e.:
>
> <img src="cid:mylogo">
>
> The comments in the PRG refer to an enhanced version of the Send-
> EmailMessage cmdlet that *does* support inline images, so go for that if
> you need to.
>
> You could look on this as analogous to using Blat from VFP, except
> without the faff involved in using Stunnel to overcome Blat's lack of
> SSL/TLS support. That support is vital for for sending via Exchange
> Online, Gmail and so on.
>
> The PRG requires at least PowerShell 3.0, which will be already present
> on anything running Windows 7 SP1 onward, or Windows Server 2008 SP1/
> Windows Server 2008 R2 onward on the server side. So forget about it on
> XP or Vista.
>
>
>
>
> --
>   Alan Bourke
>   alanpbourke (at) fastmail (dot) fm
>
>
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
>   text/plain (text body -- kept)
>   text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cacw6n4u2wentmeir2vm74ropcdn93mjxw+y9cxvlrmn3vtx...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to