Solved

VB Script Issue

Posted on 2014-03-14
2
170 Views
Last Modified: 2014-04-08
Ok, so I'm having an issue with VBScript that I cant seem to figure out. I have included it to view as an attachment. Back story: this script kicks off at 5am every morning and pulls the customer data from my SQL Database of customers for the previous day. It sends them out a "Thank You Email". The issue I'm having is that when the email gets sent, there is supposed to be an image on the top of the email, and on the  bottom, (Titled "Header" and "Footer"). When the message gets sent to the customers, the image is included on the bottom of the message, but NOT the top. I've checked everything... from making sure its visible externally through the link, the syntax of the statement, and anything else that one could check on. I have got to be missing something. I'm looking for assistance as to what I'm doing wrong and why the image on the top of the message doesn't insert into the email, but the image on the bottom does.

All entries with "XXXX" is removed data for privacy but doesn't affect the language of the script to review for accuracy.

All Help is appreciated! Thank you!
DTYE.vbs
0
Comment
Question by:matthewstrand
2 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 39929019
I'd be curious if you flip-flopped the header and footer image references what would happen...I don't see anything that stands out in the code you've posed.

I wonder if it's a similar issue which I was having yesterday with a powershell script.

Essentially, the fix was to alter the html source to reference the content id of the image.  Of course, I'm using .net mail references.  Could you alter your code to use that?

Here's a reference article: http://blogs.msdn.com/b/webdav_101/archive/2008/07/31/adding-inline-attachments-with-cdosy-and-system-net-mail.aspx
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39929032
Hi

pls try with cid

' Place HTML contents (IMG tag) into the body
objEmail.BodyText = "<html><img src='cid:pic1'></html>"

' Embed image (add as attachment with Content-ID value set)
objEmail.AddAttachment "C:\images\header.jpg", ,"pic1"

Open in new window

Regards
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question