relating url in e-mail

Posted on 2000-02-05
Medium Priority
Last Modified: 2013-12-25
How do i send an url with an e-mail (which my script automaticly send to someone). The idea is that if the receiver clicks on the url which is located in the e-mail message, he/she will be taken to my site. A script must then be able to find out who clicked on the url.
Question by:saskia

Expert Comment

ID: 2492684
I think the best would be to send the multipart MIME message
via email. Body part of the message would also have HTML
where you could make a link to your page. A link should look
something like this.

&lt;a href=mycgi&gt;http://mylink</a>;

In your cgi program you should then look who clicked on
the link and then get the user to your site. For a more detailed
description you will have to increase points.

Expert Comment

ID: 2494394

This can be easily done by calling your webpage with a querystring. For example:

where user is the the one you sent the email to.

good luck

Expert Comment

ID: 2495482
Hi Marko,

How do I rewrite the link:

&lt;a href=mycgi&gt;http://mylink</a>;

so that a description will appear instead of the complete url. And where does mycgi stand for ?
Hire Technology Freelancers with Gigs

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

LVL 85

Expert Comment

ID: 2495499

Author Comment

ID: 2497359
Adjusted points to 35

Author Comment

ID: 2497360
$mailserver="/var/qmail/bin/qmail-inject -t";
open(MAIL,"|$mailserver -t")||die "can't open sendmail\n";
print "Send to: $form{'EMAIL'}!!\n";
print MAIL "To: $form{'EMAIL'} \n\n  ";
print MAIL "From: $test \n\n";
print MAIL "Subject: $test \n\n";
print MAIL "Reply-to: $test \n\n";
print MAIL "Welcome $test \n\n";
print MAIL "&lt;a href=mycgi&gt;http://mylink</a>this is a test";       ####< Help me out on this line please
close (MAIL);
print "done\n";

Please look at ####< Help me out on this line
This is where I'm talking about, it must be a descripted url, but I keep getting the <a href ....>
sentence in my e-mails when I test the script. Can someone tell me what lines I need to change/Add ?

Accepted Solution

marko020397 earned 60 total points
ID: 2503024
From the above script I asume that you have sendmail program. Do you have the program metasend installed on your server? It is very easy to send the MIME multipart mail with metasend. Make a HTML page as it should appear in the mail. Then send the HTML via metasend. The syntax is as follows:

/usr/bin/metasend -b -t mail.address@domain.com -f mail.html -s Welcome -m \"text/html" -F my.address\@domain.com -D "Welcome mail" -S 99999999

To use the command from PERL use system command.

If you don't have metasend you will have to make a multipart MIME message by yourself. That is more complicated. Try to get metasend. If you can't get it let me know to show you how to make MIME mail by yourself.

Author Comment

ID: 2513942
ok, not exactly what i ment but it will do. tnx

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

592 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