June 28, 2016 at 2:50 pm
Hi All,
As per our requirement we are planning to capture the backup report through PowerShell, But I want to know how to get the report to mail without SMTP.
I need query for mail notifications through PowerShell without SMTP
June 28, 2016 at 2:53 pm
SMTP is the only way to send mail.
you don't have to use YOUR smtp server, you can send via a gmail account, yahoo, but it is not possible to send an email without using the smtp protocol.
you do not have to have SMTP set up locally, the server can be outside of your organization.
You do not have to enable database mail either, which is really just stored SMTP credentials but it makes it much easier.
try to explain what it is you are really trying to do, and why you think you cannot use SMTP.
Lowell
June 28, 2016 at 3:56 pm
In that server SMTP is not enabled, We want to get the Backup report through mail using PowerShell without using SMTP. IS it possible
June 28, 2016 at 6:27 pm
New persopn (6/28/2016)
In that server SMTP is not enabled, We want to get the Backup report through mail using PowerShell without using SMTP. IS it possible
Yes. Please see the post previous to yours.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 29, 2016 at 4:52 am
i get the sense you might be new to both powershell and SMTP;
think it through...you cannot use a feature without using the service behind it, so you must use someones smtp mail server to send email.
again, your organization does not have to have an SMTP mail server. if you are a lone developer, you don't run your own email service, you use someone else's mail server, whether it's company mail or gmail or whatever. that can go all the way up the food chain; lots of huge companies with tens of thousands of employees use Office365 (someone else's servers) instead of hosting their own.
here's a nice example of sending an email via powershell. all you need is the details on the username/password/server.
http://www.adminarsenal.com/admin-arsenal-blog/powershell-sending-email-with-gmail-example/
##############################################################################
$From = "YourEmail@gmail.com"
$To = "AnotherEmail@YourDomain.com"
$Cc = "YourBoss@YourDomain.com"
$Attachment = "C:\temp\Some random file.txt"
$Subject = "Email Subject"
$Body = "Insert body text here"
$SMTPServer = "smtp.gmail.com"
$SMTPPort = "587"
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `
-Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl `
-Credential (Get-Credential) -Attachments $Attachment
##############################################################################
Lowell
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply