Solved

Cdont attach image

Posted on 2006-10-25
14
346 Views
Last Modified: 2012-05-05
Hello.

I need to send a message with cdont that attach a image which I dont know how to do.

Is it better to attach the image as a ATTACHMENT FILE or actually embedded in the text itself.

For example in outlook you can either click attachment, or you can (in message body) click on insert file --> picture..

i think both ways work slightly differently, and i have tested it both ways display differently as well.

If its a attachment more often than not the user will have to open the attachment manually, but if its embedded the jpg should appear if allowed by the email client.. Am i right or wrong. i need the image to just display automaticlly,

Basically what I am sending is a birthday card for my customer which is sent automatically.  So I need to know the best way to attach the picture as there will be nothing else in the email apart from the picture.

Another question related to this is assuming you let me know the cdont code to attach an image, how can the image have a hyperlink from within the email client, so the user can click on the image and it would open the browser with a hyperlink?

Tks.
0
Comment
Question by:Ricky11
  • 7
  • 6
14 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 17802055
0
 
LVL 58

Expert Comment

by:Gary
ID: 17802060
Missed your last question - just place an hyperlink around the image tag
  .Body = "Display your embedded image like this: <a href='somepage.asp'><img src='mylogo.gif'></a>"
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17802081
Greetings, Ricky11.

This works perfectly: http://support.jodohost.com/showthread.php?t=7692

Cheers!
0
 

Author Comment

by:Ricky11
ID: 17802402
Hello Gary

Tks ur code seems to work better, Bluedevil, thanks but i get http 500 erros with that code.

Gary, There seems to be 3 ways to attatch a picture or file as so :

      AttachFile "C:\Inetpub\wwwroot\attachment.zip"
    .AttachURL "C:\Inetpub\wwwroot\logo.gif", "mylogo.gif"
    .Body = "Display your embedded image like this: <img src='mylogo.gif'>"

Now With Attatch File, I see it will attatch it as a external file which means the user has to manually open it.

With Attatch URL, it seems to embed the image in the email as html, But how can this be hyperlinked

With  using the last method where by I set the img src in the body, it needs to get it from the server, however since i delete the images from the server as soon as the emails are sent, it wont work this way.....

Bascially i need to display an image where by the image has a hyperlink.  I prefer to use . body method though

Tks.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 17802416
What you're doing with .attachurl is saying include this image with the email and the second part of that line "mylogo.gif" is the name (identifier) your setting for that particular image - if you were embedding many files then they would all have their own identifying name.
Then in your .Body you reference this name so the email knows where to embed that particular image...and to add an hyperlink look at this
.Body = "Display your embedded image like this: <a href='somepage.asp'><img src='mylogo.gif'></a>"
0
 
LVL 58

Expert Comment

by:Gary
ID: 17807105
Ricky11,
Is this all clear now?
0
 

Author Comment

by:Ricky11
ID: 17809989
Tks. All Clear.

How do i remove the blue hyperlink border around the image?

Tks.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Ricky11
ID: 17809995
border="0  duh!
0
 

Author Comment

by:Ricky11
ID: 17810104
Hmm..

I am trying to put a hyperlink with a variable.

<a href='http://www.xxxx.com/bdaypage.asp?name1=name'>

but instead of the variable name it actually displays name.

how is this type of code inserted? is it ='&name  that doesn't work.

tks.
0
 
LVL 58

Expert Comment

by:Gary
ID: 17811306
What do you mean it displays name, whats the code you have for the body text.
0
 

Author Comment

by:Ricky11
ID: 17812798
name = datars("name")

so <a href='http://www.xxxx.com/bdaypage.asp?name1=name'>

when clicked shold put the contents of the variable name inside the hyperlink..

0
 
LVL 58

Expert Comment

by:Gary
ID: 17813237
Ahh right, you need to pass in the variable as asp
.Body = "Display your embedded image like this: <a href='http://www.xxxx.com/bdaypage.asp?name1=" & name & "'>
img src='mylogo.gif'></a>"

name has to be outside the plain text so the variable value is added to the text

0
 

Author Comment

by:Ricky11
ID: 17817498
thanks... i know this is going in to another question but.

cani past the variable in a form, so that its not visable in the query string in a post?  

i know how to do it in regular html, but since this is in a cdo .body i aint sure.

tks.
0
 
LVL 58

Expert Comment

by:Gary
ID: 17818155
You can create the email exactly like a static web page, so you can place form tags, post method etc.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP VB... 7 99
ASP Classic - Load test 2 45
App wrap my classic asp based webpages (running on mysql database)? 3 113
Pass through dll 2 62
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

910 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

21 Experts available now in Live!

Get 1:1 Help Now