Wrox Programmer Forums
|
ASP E-commerce As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP E-commerce section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2005, 04:42 PM
Authorized User
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Looney
Default embed images in email using system.net.mail

Hi All , I am running asp.net2.0 beta version and using the new System.net.Mail namespace i am trying to send emails.This is part of a marketting aspect of a webapplication. i am sure many of you's would have done this aspect before .Well my problem is when i send an HTML email .The are dispatched and recieved correctly even the formatting for the page stays there when i view it in the browser but somehow the pictures attached along are not displayed .Apparently when i viewed the source code of the page from HOTmail and Yahoo. My pictures Img src were replaced .According to hotmail it was done for security purposes.Could someone please tell me a way to get around this problem .It seems like both Hotmail and Yahoo have some sorta mechanism to block them out.But then again i am sure it's possible as just last week i remember i recieved an email from Sun Microsystem's site Just a usual Newsletter , but that was full of pics and this was on my yahoo account too and i viewed it using Firefox as i am doing right now . Just can't seem to figure why ?? .as I am attaching along the pictures as attachments to my emails aswell .Here is my Html code in case if it helps .Any ideas or suggestions would be very highly appreciated ! Thanxs in advance
Code:
Dim html As String = "<html><head><title>Clipstone Yamaha NewsLetter</title><style type='text/css' >body { " + "background-color: #d5d5d5; background-image: url(bkg.gif);background-repeat: repeat-x;" + "alink='#484848' ;vlink='#484848';link='#CC0000';align = 'center'}</style></head><body>"
            html += "<table cellpadding='0' cellspacing='0' border='0' width='100%'  align='center'><tr><td width='535' style='height: 35px; text-align: left;'><img src='pixel.gif' alt='' width='22' height='1' border='0'/><img src='title.gif' alt='' width='190' height='31' border='0'/>"
            html += "<img src='pixel.gif' alt='noPixel' /></td>"
            html += "<td style='height: 35px'>53 Maroondah Hwy Ringwood 3134</td></tr></table>"
            html += "<table width='100%' align='center' > " + getHeadingString() + getDescriptionString() + getLinks() + "  </table></body></html>"
            Tex.WriteLine(html)
Looney!
__________________
Looney!
 
Old June 7th, 2005, 04:56 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

One way we often do this is not attach / embed the images. but include full Urls in the mail that points to images on our servers.

Would that work for you?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 7th, 2005, 06:16 PM
Authorized User
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Looney
Default

Hi Imar ,
          Thanks for the idea Mate .It sure works liek charm !u are a Legend. I can't believe two hrs i killed on this and it never occured to my dumb ASS !
Thanks once again !

Looney!
 
Old June 8th, 2005, 01:03 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just realize that more and more email programs will block the external images. Your readers have to explicitly tell, say, Outlook to the get images from the remote server, because otherwise they could compromise the user's privacy.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old June 8th, 2005, 02:37 AM
Authorized User
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Looney
Default

Hi Imar,firstly Thanks for the tip , though i have a question for u , what would be an alternative approach to do the same where i would n't have to face that issue.As a Newsletter sent out to 500 ppl .There is bound to be plenty of them that would not get the pictures loaded up in the first viewing atleast.I'll really like atleast something which would be placed there, in case the pics are not loaded up when the email first loads up in outlook or in browser .Maybe somethign like "Click Here to obtain the picture" , do u think that's even possible .Any suggestions of help would be very highly appreciated ,woudl using MIME or MHTML help me achieve this , else how about javascripts

Looney!
 
Old June 8th, 2005, 12:43 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I know that Outlook does that automatically. Instead of the image it shows a text asking the users to right-click the image and download it from the Internet.

If you're sending out legitimate emails, there is a fair chance your users will do so.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Faith by Limp Bizkit (Track 9 from the album: Three Dollar Bill, Yall) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
export asp.net page to ms word and embed images Itech ASP.NET 2.0 Professional 2 March 6th, 2014 03:39 AM
need to add a reference to System.Net.Mail erik BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 January 9th, 2011 04:17 PM
System.Net.Mail Problems With Sending An Email Doom C# 3 May 25th, 2008 02:49 PM
embed images in email using system.net.mail Looney Classic ASP Basics 1 June 7th, 2005 05:11 PM
embed images in html allang Pro JSP 0 August 22nd, 2004 09:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.