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
Solved

VB Script Issue

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
In this article I will describe the Backup & Restore 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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

792 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