Solved

VB Script Issue

Posted on 2014-03-14
2
165 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 48

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now