Link to home
Start Free TrialLog in
Avatar of Ricky11
Ricky11

asked on

Cdont attach image

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.
Avatar of Gary
Gary
Flag of Ireland image

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>"
Greetings, Ricky11.

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

Cheers!
Avatar of Ricky11
Ricky11

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ricky11,
Is this all clear now?
Avatar of Ricky11

ASKER

Tks. All Clear.

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

Tks.
Avatar of Ricky11

ASKER

border="0  duh!
Avatar of Ricky11

ASKER

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.
What do you mean it displays name, whats the code you have for the body text.
Avatar of Ricky11

ASKER

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..

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

Avatar of Ricky11

ASKER

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.
You can create the email exactly like a static web page, so you can place form tags, post method etc.