Embedding Images And Dynamic Content In An Email, Programmatically

In my code to send email from VBScript, I use standard CDOSYS code similar to
the following:

With oMsg
Set .Configuration = oCon
.To = """Admin"" <admin@mycompany.com>"
.From = """Joe Admin"" <jadmin@mycompany.com>"
.Subject = "Hey You!"
.TextBody = "Service(s) have failed!"
.Send
End With

I understand the use of the .HTMLBody property, as well as the
..CreateMHTMLBody method. So I know I can create an ASP or HTML page, and
pass it to the .CreateMHTMLBody method, to get the images truly embedded, so
the email source contains the cid:blahblahblah references to the images,
which is key to getting the email to display properly in web-based mail
clients.

My question is... how do I achieve the same thing (embed the images) that
the .CreateMHTMLBody method does automatically, manually, so I can also
inject values passed from a form postback into the email?

It seems that I shouldn't use the .CreateMHTMLBody method. It seems that I
need to manually accomplish what it accomplishes automatically, so I have
more granular control. But I have found no thorough online resources that
explain exactly how. I have thoroughly looked at all of the SDK information
pertaining to CDOSYS, and I am still in dire need of an example for
VBScript...

It seems that the .AddRelatedBodyPart method is part of the answer, but when
I use it to embed the images and fill .HTMLBody, rather than using the
..CreateMHTMLBody method, I do not see cid:blahblahblah in the email source,
and the images do not display properly in web-based mail clients such as
Outlook Web Access.

I really need some help on this. It would also appear that I am not alone.
I find plenty of questions on this, but no answers. Can anyone help with a
working VBScript example that embeds images into an email in a fashion that
yields the cid:blahblahblah in the email source, for the image references,
that does not use the .CreateMHTMLBody method to do the work automatically?

View Replies


ADVERTISEMENT

Embedding Images In E-mail?

I need to create HTML e-mail from an ASP program that includes embedded
images that go along with the e-mail, e.g. logos, product image, etc. Is
there a technique in HTML that people use to embed images? I know that when
I insert an image into an e-mail in Outlook, and I look at the HTML behind
it, there is a funny tak CID:

IMG hspace=0 src="cid:027301c29d8e$da6ba600$0afea8c0@MYMAIN" align=baseline
border=0>

Any clues?

View Replies View Related

Embedding Images In Emails

I'm not sure if this is the correct forum to ask this question, but I'm creating the email in ASP so I'm sure it will do...

How do you embed images into emails? I've created HTML emails that lookup images on a server when viewed but I'm trying to write a script where an image is sent with the email as the image isn't available online (only on the intranet).

View Replies View Related

Dynamic Content In ASP

I am having to make sites accessible where images are dynamically generated.

'Display the graphical hit count

Response.Write("<img src=""counter_images/")
Response.Write(Mid(lngVisitorNumber, intWriteDigitLoopCount, 1) & ".gif""")
Response.Write("alt=""" & Mid(lngVisitorNumber, intWriteDigitLoopCount, 1) & """>")
How do I include the width and height attributes in this code?

View Replies View Related

Show Dynamic Content

I have a dynamic value from a recordset that if it is a 0 value I want it to
be hidden.

something like

If Recordset.Fields.Item("CarPark") = 0 Then

value hidden

Else

Show value

View Replies View Related

To Add Dynamic Content When We Open A Mail

Any one help me out how to add additional (dynamic content) When we open a mail. Is it possible using ASP.

View Replies View Related

Dynamic Media Content And Player

I have multiple video and audio files that I want to play on my site. They are also multiple sizes. Some are 320x240 and some are other wacky sizes. What I am trying to do is create a dynamic PopUp player to embed Windows Media Player in.

I have a Database where I have put the links and the display text for the video and audio files. I am currently using JavaScript to make my PopUp window.

Is there any way with ASP I can automatically size the PopUp windows to the right size to correctly house my embedded media player? I use ASP to create the link to the PopUp Window and then once the Window is open I use ASP to get the video file, i do the same for audio files.

View Replies View Related

Dynamic Content - Main Memory Access

Dynamic Content - Is there a way to keep information in some main memory pool in IIS so that each thread of execution (each visit to the site) would have access to it. I do not want to hit the db every time a visitor hits a new page on my site?

View Replies View Related

Dynamic Table With Content Seperated Into 2 Columns

i am just trying to build a table that will put content into 2 columns. Ideally, if there were 20 hits, 1-10 would be in column 1 and then 11-20 would appear in column 2...i just can't seem to figure it out. I had started by getting a recordcount, and dividing it by 2, but things got a little fuzzy after that.

View Replies View Related

Asp Dynamic Images

i'm trying to create a function that will return an image of a specified width and height. rather than simply resizing an image and retaining its fat filesize, is there a way to create images on the fly from an original? i know it is possible in php, but the server i am working on doesn't have it

View Replies View Related

Dynamic Images

I'm building a site that requires images to be placed into a table
dynamically - the name of each image is drawn from a database reference.
(e.g database entry is "images/image1.jpg" etc). The problem is that when an
image is dynamically inserted in this way (infact its only the location of
the file thats dynamically rendered - not the image itself), i have a 2-3
pixel gap at the bottom of each image. Non dynamically attached images do
not show this behaviour. - I dont understand why this should happen.
I'm using asp 3.0 with vb-script and the image entry is expressed such,
<img src="images/mem_img_sml/<%= rstSearch.Fields("small_img").value%>.jpg"
border=0 width=60 height=60 />

View Replies View Related

Cache Images But Not Dynamic Information

Does anyone know how I can have more control over which images are cached on a particular page?

I have Response.Expires = -1000 set at the top of the page to ensure that the page isn't cached because it is important that the data from the Database is not cached (this has been a problem in the past).

Is it possible to specify which images, ie the ones that are common to all pages, will be cached and which ones won't so as to force the user to cache them and therefore make he site slightly quicker?

Obviously I understand that if the user has their own caching rules setup, these will take precedence.

View Replies View Related

Change ASP Email Content Type?

I'm runnign Win Server 2003 and using the CDOSYS method of sending an email using ASP. Is it possible to change the content type of the email to plain text?...here is my code:

'Email code'
'Define the variables first'
Dim varName, varEmail

varName = "Cinema-WAP"
varEmail = "cinema@wap.com"

'THE MAIL OBJECT'
Dim ObjMail
Set ObjMail = Server.CreateObject("CDO.Message")
objMail.From = varName & " <" & varEmail & ">"
objMail.To = finalEmail
objMail.Subject = "Hi " & bookerName & ", your Cinema-WAP booking REF: " & finalRef
objMail.HTMLBody = "<ul>" &_
"<li>Film:</li>&nbsp;<b>" & finalMovie & "</b>" &_
"<li>Screen name:</li>&nbsp;<b>" & finalScreen & "</b>" &_
"<li>Number of seats booked:</li>&nbsp;<b>" & seatID & "</b>" &_
"<li>Date:</li>&nbsp;<b>" & finalShowing & "</b>" &_
"<li>Name:</li>&nbsp;<b>" & bookerName & "</b>" &_
"<li>Mobile phone:</li>&nbsp;<b>" & bookerTel & "</b>" &_
"<li>Email:</li>&nbsp;<b>" & finalEmail & "</b>" &_
"<li>Cost:</li>&nbsp;<b>£" & finalPrice & "0</b>" &_
"</ul><br>" &_
"Enjoy the film!</font>"

objMail.Send

Set objMail = Nothing

View Replies View Related

Mail Content-type And Messages In One Email ASPMailCtrl.1

What I want to do, is to be able to send only one email with tow header text/plain and text/html with two different messages

I was able to do it only to send two email with different content-type and messages, but I would like it to send only one email with two content-type headers and two messages ...

View Replies View Related

Embed Web Based Images In Email

I know there is AddEmbeddedImage but does this only work only for images on your hard drive - can it be used for images that are web based? If not is there a way to embed an image in an email on the fly before sending - all web based?

View Replies View Related

How Can We Send Email With Links And Images By Using CDOSYS?

I have a CDOSYS mail and it's working ok but it sends plain text massage. But i want to send with images and links. But when i put a link with image in the .HTMLBody field like <a href="http://www.mysite.com/"><img src="file:///C:/My Documents/image.gif" border="0"></a> so, i got an error message.

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/cdo/cdosys.asp, line 41 .....

View Replies View Related

How To Register DLL Programmatically?

I have this ASP page that checks if a certain DLL is registered on a client machine. If it ain't registered, then it should be registered.

Here is the part of my code that supposedly registers the dll: Code:

View Replies View Related

Embedding Html In Asp

I have an asp page where I am generating an email but I need to have a link in the email body. Here is my code, I cannot get anything to work. I keep getting missing end of statement. Code:

<%
TheText2 = TheText2 & "HalCAP Request Number = " & rsOID("oid") & Chr(13)&Chr(10) & Comments
TheText2 = TheText2 & "<html><body><a href=""admin_31.asp?reqid=<%=quoteoid%>"">View Request</a></body></html>"
%>

View Replies View Related

Embedding HTML

if I have a block of HTML which I can insert into a file, I know there a PHP way of doing it just don't know the VB way to do it, anyone come accross this?

View Replies View Related

Dynamic Email Links

I am storing data in a table in Access, one of the fields contains email addresses (field is set as 'text' not 'hyperlink').

When I retrieve these records from my website how do I show them as mailto links?

Here is what i've tried...I don't even know if it's close.

<a href="mailto:" & <%=(rsContacts.Fields.Item("ContactEmail").Value)%> & >" & <%=(rsContacts.Fields.Item("ContactEmail").Value)%> & "</a>

I know that I could just add "Mailto:" before the recordset, but I don't want this to show on the page.

View Replies View Related

Dynamic Email Display

i have this output from a recordset

<%=(RS1.Fields.Item("EMAIL").Value)%>

how can i change this so that it's a hyperlink and when a user clicks on it, it will show the email address in "send to:" in outlook.?

View Replies View Related

Embedding XML Data In An ASP Page

I'd like to display XML data in a table in an ASP page. Seems like XSL and XML don't like that because ASP commands within the document cause the page to not be "well-formed"...

anybody know how to do what I want to do? Point me to a good online tutorial...i'll be looking too in the meantime.

View Replies View Related

Programmatically Make .MHT Files

I would like to programmatically scrape and generate .MHT files for archival purposes. Is this possible. Has anyone dealt with a need like this.

View Replies View Related

CDONTS !! Dynamic Data In Email

I am trying to generate an email from the webpage using code below, which
works fine. However I want to be able to include some dyanmic data how do I
go about it ?can anybody point me in the direction of some sample code ?

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<%

Dim myMail
Dim HTML
Set myMail = CreateObject("CDONTS.NewMail")

HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"""
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<meta name=""GENERATOR"""
HTML = HTML & " content=""Microsoft Visual Studio 6.0"">"
HTML = HTML & "<title>HTMLMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"">"
HTML = HTML & "<IMG SRC=""http://www.microsoft.com/library/"
HTML = HTML & "images/gifs/homepage/microsoft.gif"" BORDER=0 "
HTML = HTML & "WIDTH=167 HEIGHT=36 ALT=""Microsoft Corporation"">"
HTML = HTML & "<p><font size =""3"" face=""Arial""><strong>"
HTML = HTML & "Microsoft Exchange CDONTS Example</strong></p>"
HTML = HTML & "<p><font size =""2"" face=""Tahoma"">"
HTML = HTML & "CDO for NTS allows an easy way to send mail.<br>"
HTML = HTML & "This example shows how the content can be "
HTML = HTML & "an HTML page<br>"
HTML = HTML & "which allows you to send rich text and"
HTML = HTML & "inline graphics.</p>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"

myMail.From="someone@microsoft.com"
myMail.To="someone@microsoft.com"
myMail.Subject="Sample CDONTS HTML Message"
myMail.BodyFormat=0
myMail.MailFormat=0
myMail.Body=HTML
myMail.Send
set mymail=nothing
Response.Write "Message Sent"
%>
</HEAD>
<BODY>
</BODY>
</HTML>

View Replies View Related

Sending Dynamic Html Email

I am currently building an emailing system into our asp management system. From this we will be able to setup mail templates (html stored in mssql database) and select who we want to send them to.The html in the database is only the middle part of the html file being sent. All the emails are based on the same design template using a single html file to which I pass a variable saying which body to get from the database <%=writeBody%>. So far this is all working fine and the emails are sending using cdo.

..createMHTMLBody
"http://localhost/helpCentric/responseSendForm.asp?"&qString

What i am trying to do now is personalise the emails and on the responseSendForm.asp I connect to the database and create variables such as fName, lName etc.I need to be able to write these variables in the html in the database which will then display in the body using the <%=writeBody%>.As you may have guess this is not working and I dont know enough aboutthe .createMHTMLBody to work out what to do.

View Replies View Related

Create A Brand New MSSQL DB Programmatically

I am a ASP Developer w/ Access Backend. I am new to MS SQL But i knew that MSSQL has a big upper hand against MsAccess I am currently running my website w/ MsAccess DB for Members. If i wanted to transfer all the data from Access to MSSQL. I use Virtual Hosting. So i have less access for installing a converter.

Can anyone help me for coding to create a brand new MSSQL database and transfer the Contents. Get me the basic coding. I wanted everything to be programmatically. Atleast help me Create a New DB in MSSQL I have an Idea for Transfering if it works.

My idea is to create DSN for both of them (My Control Panel Allows DSN Creation for both Access and MSSQL) and transfer through two recordsets and connections. That Part is almost OK.

View Replies View Related

Sending Dynamic Input Data Through Email

I have sent form data through email using .asp before but I have never done it when you are using a form that has createelements involved. I have a form w/ 3 inputs, two text inputs and one select combo box. if i click an add user button it will appear with another row of 2 text boxes and a combo box, and you can repeat up to as many as you need. I am trying to figure out how to mail all of those values to someone. Is there an easy way. Below I will attach the code that I use to name the fields when they are generated maybe it will help....

<SCRIPT language="javascript">
counter = 1

function addRow(id){
var tbody = document.getElementById(id).getElementsByTagName("TBODY")[0];
var row = document.createElement("TR");
row.setAttribute("id","tr"+counter);


var td2 = document.createElement("TD");
var input2 = document.createElement("INPUT");
input2.setAttribute("type","text");
input2.setAttribute("name","pName"+counter);
input2.setAttribute("id","name"+counter);
td2.appendChild(input2);

var td3 = document.createElement("TD");
var input3 = document.createElement("INPUT");
input3.setAttribute("type","text");
input3.setAttribute("name","userName"+counter);
input3.setAttribute("id","prc"+counter);
td3.appendChild(input3);

var td4 = document.createElement("TD");
var input4 = document.createElement("select");
input4.name = "Role"+counter;
input4.id = "Role"+counter;
option = document.createElement("OPTION");
option.value ="Admin";
option.text = "Admin";
input4.add(option);
option = document.createElement("OPTION");
option.value ="Read";
option.text = "Read";
input4.add(option);
option = document.createElement("OPTION");
option.value ="Read/Write";
option.text = "Read/Write";
input4.add(option);

td4.appendChild(input4);

row.appendChild(td2);
row.appendChild(td3);
row.appendChild(td4);
tbody.appendChild(row);

counter++;

}
</SCRIPT>

View Replies View Related

Need Help Sending CDO Email With Dynamic HTML Attachment

I'm using CDO SYS to send email messages. I can attach a file just fine.
However, I need to attach an HTML page that's generated on the fly by my
ASP code. The attachment source code gets assembled into a VB string. How
do I attach this? I think there was an easy way in CDONTS but that's no
longer an option.

View Replies View Related

Embedding An AxtiveX That Prints On The Local Printer.

Is it possible to write in VB6 an activeX that will receive a RecordSet and
display a data report and then print it on a local/network printer?

View Replies View Related

Programmatically Visiting A URL Without Opening Browser Session

Using ASP, is there an easy way in code to "visit a URL", without opening a
browser session?

Explanation: I have a page caching class. The page caching class's behavior
can effectively be "programmed" via instructions that are sent through the
querystring. When members of our staff update articles using a CMS I
programmed, I would like the cache to be flushed. The cache can be rebuilt
by issuing an instruction via a URL querystring.

I would like the machine to programmatically "visit" two different URLs
without actually showing those pages to the user.

View Replies View Related

Problems With GetObject When Embedding Vbs In An HTML Page

I have a vbs script that retrives some stuff from AD via LDAP. Works great, and does exactly what I want it to go. The 'guts' of the app is Code:

Set objOU = GetObject (strOU)

Where strOU is something like "LDAP://OU=Users,OU=OT...." etc. Like I say this works fine and generates a nice report.

However I have to (I don't know why, but it's an insist) that this script has to be an html page. A stand alone one at that (ie to be run form a users workstation).

I rewrote the code to output to the html page, emebeded it in <script language="VBscript"> etc but the GetObject bit isn't working. I get :

Code:

View Replies View Related

Change ASP Web Form Background Color Programmatically

I have web page that I use for add/delete/modify records from a database. Depending on what the user desires on previous web page this particular web page allows users to add, modify, or delete the record from a database. Each has different directions and labels on buttons are change with in code.

My users also want the background color for add web page to be one color, modify web page to be different color, and delete web page third color. In VB this was form.background color, but can not seem to find solution in MSDN for this one.

View Replies View Related

How Can I Load A Web Programmatically From Another Website, And Save It To Disk?

I need to load a load a web page and save the whole page to a file.

I tried ADODB.Stream.Open
"URL=http://www.someurl.com/default.asp?parameter=somevalue"

this fails when you append querystring parameters to the URL. Otherwise it
would have been fine.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved