Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Script Issue

Posted on 2014-03-14
2
Medium Priority
?
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 52

Accepted Solution

by:
Rgonzo1971 earned 1500 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 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