Hi,
Thanks for reading this. I have searched all over the web but found no solution. How would one change a url to a hyperlink and email the hyperlink...I parsed through an html file to get this -
</table><br><div><a class="red_link" href="http://dabcd123456:80/results/report.jsp?a=HGUYU&b=HGUYU&c=%2Fc%2B%2Btest%2F&id=%3Ademd140149%3A1193283688721.html%2BDefault%2Bsmith%3A">TCM report >>></a></div><br><table width="95%" border="1" bordercolor="#999999" cellpadding="0" cellspacing="0">
-
and I parse and got the url out:
"http://dabcd123456:80/results/report.jsp?a=HG UYU&b=HGUYU &c=%2Fc%2B% 2Btest%2F&i d=%3Ademd140149 %3A119328368872 1.html%2BDefaul t%2Bsmith%3A">
How can I change the url into a hyperlink and send that link in an email to someone?
Thanks,
Monkey
6 5434 numberwhun 3,509
Recognized Expert Moderator Specialist
What have you tried thus far? Can you please share your code with us?
Regards,
Jeff
Hi,
I tried a bunch of stuff, but they don't work, so I deleted them already..this is the last thing I tried ##my $content = get $url; that doesn't work either. I also tried the string replacement, but that's too cumbersome and if the url changes it would be no good! $text =~ s[($RE{URI}{HTTP} )] doesn't work
This is what I have so far that works in extracting the URL -
my($File) = @_;
-
open(STDIN, $File) || die("Could not open file!");
-
while(<STDIN>){
-
my($data)=$_;
-
##print "$data \n";
-
if ($data =~ m/(http.*).+report/i ){
-
##print "$1 \n"
-
}
-
}
-
close(STDIN);
-
Please help!
Thanks,
Monkey
numberwhun 3,509
Recognized Expert Moderator Specialist
Monkey,
In your original post and in the last post, I had to place the necessary code tags in your post. Please be sure, per the document in the link, to add them to all future code posting.
Regards,
Moderator
eWish 971
Recognized Expert Contributor
Would you please post some sample data from the file you are using? If you are getting a match into $1 and it contains only the url then you can do something like this. -
my($File) = @_;
-
open(STDIN, $File) || die("Could not open file!");
-
while(my $data = <STDIN>){
-
if ($data =~ m/(http.*).+report/i ){
-
my $link = qq{<a href="$1">Click Me</a>};
-
&send_email($link); #Send $link as an arugement to a sub that will then include the $link in the body of the message.
-
}
-
}
-
close(STDIN);
-
-
sub send_email {
-
-
my ($email_link) = @_;
-
-
my $message_type = 'text/html';
-
my $from_email = 'From@someemail.com';
-
my $to_email = 'To@someemail.com';
-
my $subject = 'Requested Link';
-
my $message = qq{Hello here is your link $email_link};
-
-
#You can use any email module you wish. Example given with Mime::Lite;
-
use Mime::Lite;
-
-
my $msg = MIME::Lite->new(
-
From => $from_email,
-
To => $to_email,
-
Subject => $subject,
-
Type => $message_type,
-
Data => $message
-
);
-
-
$msg->send() || die "Couldn't send message:";
-
}
Hi eWish,
Thank you for your response, this is what I need. Thanks so much. You save me hours =)
Monkey
eWish 971
Recognized Expert Contributor
Glad to hear it helped. :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Gareth Clayton |
last post by:
I have imported a title list from excel to an access database table
and would like to know how to
change the imported URL which is long and ugly into html hyperlink
code with the title
name as the actual hyperlink. eg <a href=URL><u>TITLE</u></a>
The title and url are different for each record.
At the end of it all I want to be able to import the database record
(hyperlink) using the database results
component in frontpage to create a...
|
by: Robbo |
last post by:
Hello, I created a datagrid with a few hyperlink columns.. How do i change
the color of the hyperlink itself? BLUE is a bit bad on my datagrid
color scheme.
Thanks,
Rob
|
by: Ryan Harvey |
last post by:
Hi all,
I have written a web user control that contains a repeater control. the
ItemTemplate for this control is basically 6 Hyperlinks in a row, that are
dynamically allocated one of 7 gif images as the ImageURL of the Hyperlink.
When a load the page with the controls on it works fine, but sometimes the
images are broken, but if i hit refresh i get random selections of the gifs
appearing and not appearing. if i hit Back button to a page...
|
by: Imran Aziz |
last post by:
Hello All,
I want to change the size of my hyper lnks in a repeater control dynamially
using the onItemBound event, as under, but cannot seem to understand how to
alter the properties to do that.
<asp:HiddenField ID="maxFrequency" runat="server" />
|
by: eswanson |
last post by:
In jscript, I would like to be able to set the href attribute of the anchor
element. I have a aspnet:hyperlink button on the page, but I would like to
be able to set the href attribute of this element via jscript.
How do I do this?
I am attempting to prevent extra trips to the server. Currently, I set the
navigateurl in server side scripting, but I know the answer on the client.
Thanks
| |
by: Vear |
last post by:
I have a gridview inside a content placeholder that has the first column as a
hyperlink. I changed it from a Hyperlinkfield to a Template field so I could
name the hyperlink control. I can't figure out how to reference it so I can
change the URL depending on which Stored procedure I bind to it during form
load.
Is there a way to change it URL via VB. This is in a content form within a
master page if that makes any difference.
Thank...
|
by: jarrett.roberts |
last post by:
I am relatively new with C# and ASP.NET. I created an application
using WinForms in which I have several hyperlinks. I want their
position on the webpage to be determined (dynamically) based on the
state of the user. I have been checking online, but I can't find
anywhere that explains how I can change the position (coordinates) of
my HyperLink object in a way similar to below:
Hyperlink h;
h.X = 124;
|
by: =?Utf-8?B?Um9nZXI=?= |
last post by:
In my app I would like to change the color of the hyperlink from blue to
purple when a user clicks the hyperlink in a RichTextBox.
The DetectUrls property is set to True and I handle the
RichTextBox1.LinkClicked event to launch a browser window. That works fine.
The problem is that once the DetectUrls property is True the RichTextBox
control shows the link in blue even if I select the text and change the
SelectionColor to purple.
For...
|
by: simonyong |
last post by:
Hi,
I have a hyperlinkbutton in my datagrid
Initially, I set the text of the hyperlink button as "show"
once user click it, i want it to change into "view more detail"
I tried to change as below but it lose its hyperlink function and just as a text only
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |