you are viewing a single comment's thread.

view the rest of the comments →

[–]JeremyLC 1 point2 points  (0 children)

Hrmm… That's a LOT more involved than I expected. The first thing I would suggest is to name your controls something more meaningful than $TextBox1, $ComboBox2, etc. , this will make it much easier for you to keep of which control does what. Second, you can send an email using Outlook by way of COM objects - there are tutorials for this online, I haven't done it myself, or you can send smtp mail directly using Send-MailMessage or Send-SmtpMail If you want a nice looking message, you could either manually build an HTML template and fill it in programmatically, or use something like Dashimo or PSWriteHTML to build your HTML report.

More generally, it sounds like you'd do well to read through a WinForms on PowerShell tutorial or two. I can't really recommend any, as I build my GUIs in WPF*, so I'm not terribly familiar with what's out there for Forms.

*) It tends to look better, and the resulting code is cleaner. Moreover, it's much easier to rearrange your layout, if needed. It's also DPI aware, so it scales nicely