keyongtech


  keyongtech > windows.* > windows.powershell

 #1  
05-07-08, 12:17 AM
Matt Duguid
Hi there,

I have been searching for some sample code for "embedding images in html
email from powershell". I can get images to link from a URL but want to embed
them as a lot of email programs will block links to external URL's for
obvious reasons or require you update the "trusted site zone" or create a
"safe senders list".

I can find sample code in a various languages using "System.Net.SmtpClient"
and "System.Net.Mail.MailMessage" but nothing with a powershell example.

If anyone knows of one can they point me in the right direction?

Thanks,

Matt Duguid
 #2  
05-07-08, 02:00 AM
Marco Shaw [MVP]
Matt Duguid wrote:
> Hi there,
>
> I have been searching for some sample code for "embedding images in html
> email from powershell". I can get images to link from a URL but want to embed
> them as a lot of email programs will block links to external URL's for
> obvious reasons or require you update the "trusted site zone" or create a
> "safe senders list".
>
> I can find sample code in a various languages using "System.Net.SmtpClient"
> and "System.Net.Mail.MailMessage" but nothing with a powershell example.
>
> If anyone knows of one can they point me in the right direction?
>
> Thanks,
>
> Matt Duguid


Maybe this will help:
http://ozgrant.com/2007/07/25/powers...il-a-log-file/

Marco
 #3  
05-07-08, 02:27 AM
Keith Hill [MVP]
"Matt Duguid" <MattDuguid> wrote in message
news:9a30
> Hi there,
>
> I have been searching for some sample code for "embedding images in html
> email from powershell". I can get images to link from a URL but want to
> embed
> them as a lot of email programs will block links to external URL's for
> obvious reasons or require you update the "trusted site zone" or create a
> "safe senders list".
>
> I can find sample code in a various languages using
> "System.Net.SmtpClient"
> and "System.Net.Mail.MailMessage" but nothing with a powershell example.
>
> If anyone knows of one can they point me in the right direction?


See if this helps:

http://www.codeproject.com/kb/IP/embedemailimages.aspx
 #4  
05-07-08, 02:42 AM
Matt Duguid
Hi Marco,

I saw that one earlier on my trawl through various google results but thanks
for the post.

What I am after is to be able to "embed" an image in an html email generated
from Powershell using either the "System.Net.SmtpClient" or
"System.Net.Mail.MailMessage" class.

I have listed a C sharp code sample below but I need a powershell one if
anyone can help or point me in the right direction.

http://www.codeproject.com/script/co...ding_mail.aspx

Thanks,

Matt Duguid


"Marco Shaw [MVP]" wrote:
[..]
 #5  
05-08-08, 01:06 PM
Hal Rottenberg
Matt Duguid wrote:
> I have been searching for some sample code for "embedding images in html
> email from powershell". I can get images to link from a URL but want to embed
> them as a lot of email programs will block links to external URL's for
> obvious reasons or require you update the "trusted site zone" or create a
> "safe senders list".


Slightly related, iTripoli posted a cool app on their site which among other
things, embeds an image inside of the powershell code. It might be useful for
you. Also note that the Admin Script Editor can handle the work of embedding
the images.

http://adminscripteditor.com/player/
Similar Threads
Thread Thread Starter
VBscript embed images in HTML email body

Hi Im sending email's using the "script task" of SQL Server 2005 Integraton Services. The email body is an HTML string . Now i want to embed image in that body.I tried to do...

sumit.halder
how do i embed images in an email

Hi, How do I embed an image into a htm email stationery? Cheers

Lenny
how to embed images in email using C++

Hi, I want to know how to embed images into an email using C++. I am currently using CMIMEMessage and it looks like it can not be done using it.. my code is like...

Lewis Yeung
How to embed images in html email

I have a vb.net program that sends out html emails via smtp on a windows 2003 server. Question I have is how do you embed images in an html email message? You get to...

ComStar
Looking for sample code to send email with exchange

Does anybody have sample code to send email using exchange from an MFC application. Thanks Tom G

Tom Groszko

Privacy Policy | All times are GMT. The time now is 03:41 PM.

Merging Information Logo
[Deutschland] [Espaņa] [France] [Italia] [Nederland] [Polska] [United Kingdom]