-
Feb 25th, 2017, 12:58 PM
#1
Thread Starter
Hyperactive Member
Image not appearing
Hello
I am trying to use a background image in a SMTP HTML email with the following code, but the image does not appear:
Code:
Dim Logo As New LinkedResource(Server.MapPath("~/Images/emailBG.jpg"), "image/jpeg") 'embedded image
Logo.ContentId = "emailBG"
The background image lives in my Images folder in Solution Explorer, and is 600px x 600px which doesn't seem big according to a few articles I have read (some images are far bigger).
The SMTP code is otherwise fine - the user receives his email.
What could be the problem, please?
-
Feb 25th, 2017, 01:55 PM
#2
Re: Image not appearing
If you look at the source of the email what is the src attribute pointing to? Is the url accessible publicly?
-
Feb 25th, 2017, 02:01 PM
#3
Thread Starter
Hyperactive Member
Re: Image not appearing
Thanks for your reply.
No. The image exists only in a folder in Solution Explorer. As far as I know, with email images, src is replaced by CID which I have done here:
Code:
Logo.ContentId = "emailBG"
None of the images used on this site have a URL - they are all in that Images folder in Solution Explorer.
-
Feb 25th, 2017, 04:50 PM
#4
Re: Image not appearing
If you look at the email's source does it appear that the images have been embedded? It might be worth checking in the debugger that it is evaluating the path to the image correctly as well.
-
Feb 25th, 2017, 05:02 PM
#5
Thread Starter
Hyperactive Member
Re: Image not appearing
Thanks again.
It's a bit bizarre. If I click on the body of the received email, right-click, and chose 'View Source', I can only see this the line of text that invites the user to click on a link to reset his password. If I click outside the received email, but still in the main inbox window of the user (me, in this case), I can see that my background image has been sent as an attachment -
in other words, no, it does not seem to be embedded, which means that, somewhere the code is wrong!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|