Hello everyone,
Can someone please tell me how I can do the following:
>From the query below, I want to get the details of the header of the message
and display them on a page, one per line.
If I just query the Header field, it displays them in one long line.
What can I do to display the them one per filed?
sub _converttoHTML {
my $self = shift;
my $string = shift;
$string =~ s/([^\s\<]+\@[^\s\r\,\;\>]+)/\%lta
href\=\"$self->{_ScriptUrl}?action=mailto&email=$1\"\%gt$1\%lt\/a\%gt/g;
$string =~ s/\&/\&\;/g;
$string =~ s/\</\<\;/g;
$string =~ s/\>/\>\;/g;
$string =~ s/\%lt/\</g;
$string =~ s/\%gt/\>/g;
return $string;
}
This is the code where the haeder gets displayed:
$self->_converttoHTML($self->{_Header}
my $query = "SELECT
EmailID,Header,ToWho,FromWho,EmailFrom,FormattedDate,Subject,Content_Type,Si
zeOf,";
$query
.="Location,NumOfAttachments,Notes,CC,Unread,BCC,SaveCopy,SendHTML,Priority,
Signature FROM EMAILS WHERE ";
$query .="EmailID = $EmailID AND UserID = $UserID";
my $sdb = $self->{_dbobj}->prepare("$query");
$sdb->execute;
while(my($EmailID,$Header,$ToWho,$FromWho,$EmailFrom,$FormattedDate,$Subject
,$Content_Type,$SizeOf,$Location,$NumOfAttachments,$Notes,$CC,$Unread,$BCC,$
SaveCopy,$SendHTML,$Priority,$Signature)=$sdb->fetchrow_array) {
$self->{_EmailID} = $EmailID;
$self->{_Header} = $Header;
$self->{_ToWho} = $ToWho;
$self->{_FromWho} = $FromWho;
$self->{_EmailFrom} = $EmailFrom;
$self->{_FormattedDate} = $FormattedDate;
$self->{_Subject} = $Subject;
$self->{_SizeOf} = $SizeOf;
$self->{_Location} = $Location;
$self->{_NumOfAttachments} = $NumOfAttachments;
$self->{_Notes} = $Notes;
$self->{_Content_Type} = $Content_Type;
$self->{_CC} = $CC;
$self->{_BCC} = $BCC;
$self->{_SaveCopy} = $SaveCopy;
$self->{_SendHTML} = $SendHTML;
$self->{_Unread} = $Unread;
$self->{_Signature} = $Signature;
$self->{_Priority} = $Priority;
last;
}
The header should look like this:
Return-Path: <[EMAIL PROTECTED]>
Received: from site.com (ns1.site.net [216.188.0.66])
by www.site.com (8.11.1/8.11.1) with ESMTP id g8I2Eir74182
for <[EMAIL PROTECTED]>; Tue, 17 Sep 2002 19:14:44 -0700 (PDT)
(envelope-from [EMAIL PROTECTED])
Received: from servername (adsl-63-207-125-101.dsl.sndg02.pacbell.net
[63.207.125.101])
by site.com (8.9.3/8.9.3) with SMTP id TAA30428
for <[EMAIL PROTECTED]>; Tue, 17 Sep 2002 19:21:36 -0700
Reply-To: <[EMAIL PROTECTED]>
From: "Sender Name" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: test
Date: Tue, 17 Sep 2002 19:16:56 -0700
Message-ID: <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_55F6_01C25E7E.C991C8E0"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Importance: Normal
X-UIDL: =hN"!>(@!!Sa]"!Ig~"!
But it looks like this:
Return-Path: <[EMAIL PROTECTED]> Received: from site.com (ns1.site.net
[216.188.0.66]) by www.site.com (8.11.1/8.11.1) with SMTP id g8I2Eir74182
for <[EMAIL PROTECTED]>; Tue, 17 Sep 2002 19:14:44 -0700 (PDT)
(envelope-from [EMAIL PROTECTED]) Received: from servername
(adsl-63-207-125-101.dsl.sndg02.pacbell.net [63.207.125.101]) by site.com
(8.9.3/8.9.3) with SMTP id TAA30428 for <[EMAIL PROTECTED]>; Tue, 17 Sep 2002
19:21:36 -0700 Reply-To: <[EMAIL PROTECTED]> From: "Sender Name"
[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: test Date: Tue, 17 Sep
2002 19:16:56 -0700 Message-ID:
<[EMAIL PROTECTED]> MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_55F6_01C25E7E.C991C8E0" X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416
(9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Importance: Normal X-UIDL: =hN"!>(@!!Sa]"!Ig~"!
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php