Solved

Cdont attach image

Posted on 2006-10-25
14
345 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

757 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

19 Experts available now in Live!

Get 1:1 Help Now