Solved

Cdont attach image

Posted on 2006-10-25
14
347 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

12 Experts available now in Live!

Get 1:1 Help Now