Send-PnPMail Enhancements

%3CLINGO-SUB%20id%3D%22lingo-sub-37949%22%20slang%3D%22en-US%22%3ESend-PnPMail%20Enhancements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37949%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20been%20about%204%20months%20since%20working%20with%20the%20PnP%20Powershell%2C%20and%20I%20see%20that%20there%20are%20many%20nice%20new%20commands.%20One%20is%20the%20Send-PnPMail%2C%20which%20is%20lovely%20but%20will%20really%20only%20be%20useful%20with%20a%20couple%20of%20enhancements%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3COL%3E%3CLI%3EIt%20would%20be%20good%20if%20the%20credentials%20that%20need%20to%20be%20passed%20could%20be%20stored%20in%20the%20Credential%20Manager%20with%20a%20label%2C%20similar%20to%20Connect-PnPOnline%2C%20so%20that%20I%20do%20not%20have%20to%20have%20them%20in%20clear%20text%20in%20the%20script.%3C%2FLI%3E%3CLI%3EIt%20would%20also%20be%20good%20if%20we%20could%20add%20attachments%20to%20the%20emails%20being%20sent.%20%26nbsp%3BSome%20of%20my%20scripts%20will%20be%20run%20on%20a%20timer%20job%20and%20will%20generate%20reports%20overnight%20(in%20plain%20text%2C%20xml%2C%20html%20or%20csv).%20%26nbsp%3BI%20would%20like%20the%20script%20generating%20the%20reports%20to%20attach%20them%20to%20an%20email%20that%20can%20be%20sent%20to%20a%20user%20so%20that%20when%20they%20arrive%20at%20work%20in%20the%20morning%2C%20the%20reports%20are%20sitting%20in%20their%20inbox.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EI%20do%20have%20a%20work-around%20that%20uses%20the%20plain%20vanilla%20PowerShell%26nbsp%3BSend-MailMessage%20cmdlet%2C%20but%20it%20would%20be%20nice%20to%20be%20able%20to%20skip%20all%20of%20the%20SMTP%20set%20up%20and%20parameters%20and%20just%20use%20the%20O365%20SMTP%20mail%20server%20instead.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20listening!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-251696%22%20slang%3D%22en-US%22%3ERe%3A%20Send-PnPMail%20Enhancements%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-251696%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20you%20shall%20post%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fissues%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fissues%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

It's been about 4 months since working with the PnP Powershell, and I see that there are many nice new commands. One is the Send-PnPMail, which is lovely but will really only be useful with a couple of enhancements:

 

  1. It would be good if the credentials that need to be passed could be stored in the Credential Manager with a label, similar to Connect-PnPOnline, so that I do not have to have them in clear text in the script.
  2. It would also be good if we could add attachments to the emails being sent.  Some of my scripts will be run on a timer job and will generate reports overnight (in plain text, xml, html or csv).  I would like the script generating the reports to attach them to an email that can be sent to a user so that when they arrive at work in the morning, the reports are sitting in their inbox.

I do have a work-around that uses the plain vanilla PowerShell Send-MailMessage cmdlet, but it would be nice to be able to skip all of the SMTP set up and parameters and just use the O365 SMTP mail server instead.

 

Thanks for listening!

1 Reply
Highlighted

Hi,

 

I think you shall post in https://github.com/SharePoint/PnP-PowerShell/issues

 

Regards