Note that there are some explanatory texts on larger screens.

plurals
  1. POembedded html powershell email compressing pic length
    primarykey
    data
    text
    <p>I have a powershell script that embedds (not attaches) a picture and sends an email. The picture has increased now to 1500x5000 pixels and now I'm seeing that the pictures lenth gets compressed and it distorts the picture. How ever, when I manually insert the picture via outlook and send an email, it looks fine. </p> <p>If i save the picture and then open it via paint or something, the picture opens fine. It just looks compressed in the email. Anyone know what may be going on there?</p> <pre><code>{ $Application = "C:\Autobatch\Spotfire.Dxp.Automation.ClientJobSender.exe" $Arguments = "http://s.net:8070/spotfireautomation/JobExecutor.asmx C:\Autobatch\HourlyStats.xml" $CommandLine = "{0} {1}" -f $Application,$Arguments invoke-expression $CommandLine $file = "C:\Autobatch\HourlyStats.png" $smtpServer = "smtp.staom.sec.s.net" $att = new-object Net.Mail.Attachment($file) $att.ContentType.MediaType = “image/png” $att.ContentId = “pict” $att.TransferEncoding = [System.Net.Mime.TransferEncoding]::Base64 $msg = new-object Net.Mail.MailMessage $smtp = new-object Net.Mail.SmtpClient($smtpServer) $msg.Attachments.Add($att) $msg.From = "d.k@s.com" $msg.To.Add("r.p@p.com") $msg.Subject = "Voice and Data Hourly Stats" $msg.Body = "&lt;p style=’font-family: Calibri, sans-serif’&gt; Voice and data hourly stats details&lt;br /&gt; &lt;/p&gt; &lt;img src='cid:pict'/&gt;" $msg.IsBodyHTML = $true $smtp.Send($msg) $att.Dispose() invoke-expression "DEL $file" } </code></pre> <p>here is what the picture looks like in the email.<img src="https://i.stack.imgur.com/RWxVE.png" alt="compressed pic"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload