jump to navigation

Send Mail Power Shell March 6, 2018

Posted by juanpablo1manrique in SharePoint.
Tags: ,

SharePoint 2013 Management Shell – SharePoint 2010 Management Shell
$sd = new-object System.collections.specialized.stringdictionary
$sd.add(“Subject”,”The clue is in the name!”)
$web = get-spweb “http://misharepoint/”
$body = “This is our body<br/> We can use <strong>HTML</strong> codes in it.”


Windows Power Shell 1
Send-MailMessage -To “uncorreodest@undominio.co” -From “unorigen@undominioorg.com” -Subject “Test mail” -Body “Body aaaa” -SmtpServer “smtp.unorigen.com”

Windows Power Shell 2

$message=new-object Net.Mail.MailMessage;
$smtp=new-object Net.Mail.SmtpClient(“smtp.unorigen.com”,”25″);
$smtp.EnableSSL = $false;
$smtp.Credentials = New-Object System.Net.NetworkCredential(“undominio\unusuario”, “*************”);


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: