Solved

VB Script Issue

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

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

In this article I will describe the Detach & Attach 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.
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

822 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