Solved

Cdont attach image

Posted on 2006-10-25
14
349 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
[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
  • 7
  • 6
14 Comments
 
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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
 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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 video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

729 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