By: Paul Cunningham
If you use the Send-MailMessage cmdlet to send emails from PowerShell it has an -Attachments parameter. https://technet.microsoft.com/en-us/library/hh849925.aspx
View ArticleBy: Ricky Valencia Valencia
HI Paul, Great article. I have a question. I have 2 files (txt files) and the contents of those file I want to make it as email message content and send to my email. How can I do that? THank you.
View ArticleBy: Ricky Valencia Valencia
Hi Paul, Kindly ignore my previous question. I was able to find the solution. I have a second question though, how do i send to multiple recipients?
View ArticleBy: Tabrez
Hi Ricky, I have the same problem, I have power shell script for sending backup log file (.txt)in email attachment from task scheduler & its working fine . now I want to send .txt file contents in...
View ArticleBy: Steve
Very nice (was on the verge of saying elegant). Too bad Send-MailMessage doesn’t do this automatically for txt files (ie treat it as/is).
View ArticleBy: Sean Noy
Hi Eddie, You can create a distribution group and send to that address or create a variable and separate the recipients with , example: $recipients = “Boss “, “employee1 ” Send-MailMessage -To...
View ArticleBy: Florisz
@Ricky Valencia If you find a solution to put file.txt content in the message body of the email, it would be nice if you share that knowledge here too! I and others have the same question.
View ArticleBy: Paul Cunningham
Ingest the file contents to a variable using Get-Content, then use that variable as the message body. Eg.. $filecontent = Get-Content .\File.txt Then in the Send-MailMessage command use the -Body...
View Article
More Pages to Explore .....